From: Mathieu Desnoyers Date: Fri, 15 Jul 2016 15:29:33 +0000 (-0400) Subject: Fix: tests/Kbuild for older kernels X-Git-Tag: v2.8.1~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f37e05c62a2f5739e2f25db53cb6dc741029547c;p=lttng-modules.git Fix: tests/Kbuild for older kernels Older kernels (e.g. 2.6.38.8) don't seem to handle subdirectory in the same way as recent kernels (e.g. 4.6). As a result, building LTTng out-of-tree within a kernel modified to have LTTng as a built-in addon fails with CONFIG_LTTNG=m. $ make all O=../kernel_builddir ..... CC [M] lttng/probes/lttng-kprobes.o CC [M] lttng/probes/lttng-kretprobes.o LD lttng/tests/built-in.o CC [M] lttng/tests/probes/lttng-test.o Assembler messages: Fatal error: can't create lttng/tests/probes/lttng-test.o: No such file or directory /media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/scripts/Makefile.build:264: recipe for target 'lttng/tests/probes/lttng-test.o' failed make[3]: *** [lttng/tests/probes/lttng-test.o] Error 2 /media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/scripts/Makefile.build:403: recipe for target 'lttng/tests' failed make[2]: *** [lttng/tests] Error 2 /media/awallin/sda1/home/awallin/src/lttng-test/linux-2.6/Makefile:946: recipe for target 'lttng' failed make[1]: *** [lttng] Error 2 make[1]: Leaving directory '/media/awallin/sda1/home/awallin/src/lttng-test/kernel_builddir' Makefile:146: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 $tree ../kernel_builddir/lttng/tests/ ../kernel_builddir/lttng/tests/ └── built-in.o Reported-by: Anders Wallin Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/Kbuild b/tests/Kbuild index 340b71bb..5e49007a 100644 --- a/tests/Kbuild +++ b/tests/Kbuild @@ -4,8 +4,10 @@ include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds ccflags-y += -I$(TOP_LTTNG_MODULES_DIR) -obj-$(CONFIG_LTTNG) += probes/lttng-test.o +obj-$(CONFIG_LTTNG) += lttng-test.o +lttng-test-objs := probes/lttng-test.o -obj-$(CONFIG_LTTNG) += clock-plugin/lttng-clock-plugin-test.o +obj-$(CONFIG_LTTNG) += lttng-clock-plugin-test.o +lttng-clock-plugin-test-objs := clock-plugin/lttng-clock-plugin-test.o # vim:syntax=make