Re: External module Makefile with generated C file

From: Arnaldo Carvalho de Melo
Date: Sat Jan 27 2007 - 13:40:21 EST


Jan Engelhardt wrote:
ctracer_methods.o: ctracer_methods.c

$(obj)/ctracer_methods.o: $(src)/ctracer_methods.c

$(src)/ctracer_methods.c:
...



I don't know if $(obj) or $(src) is the right thing, but something along
these lines is required for OOT.

Thanks, that did the trick, resulting Makefile:

obj-m := ctracer.o

ctracer-y := ctracer_methods.o ctracer_jprobe.o

# Files generated that shall be removed upon make clean
clean-files := ctracer_methods.c

CLASS=sock
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -f *.mod.c *.ko *.o ctracer_methods.c

$(obj)/ctracer_methods.o: ctracer_methods.c

$(src)/ctracer_methods.c:
ctracer /usr/lib/debug/lib/modules/$(shell uname -r)/vmlinux $(CLASS) > $@

- Arnaldo


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/