From: Francis Deslauriers Date: Fri, 30 Apr 2021 15:14:20 +0000 (-0400) Subject: Fix: Makefile: generation of specific .i file not working X-Git-Url: https://git.lttng.org/?p=lttng-modules.git;a=commitdiff_plain;h=c93e15272d8c032644e5dbca986fad0cfb4911bf Fix: Makefile: generation of specific .i file not working Issue ===== When trying to get the preprocessed version of the `lttng-syscalls.c` file I get the following error: $ make src/lttng-syscalls.i make -C /lib/modules/5.4.0-67-generic/build M=/home/frdeso/projets/lttng/modules/src CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m src/lttng-syscalls.i make[1]: Entering directory '/usr/src/linux-headers-5.4.0-67-generic' make[3]: *** No rule to make target '/home/frdeso/projets/lttng/modules/src/src/lttng-syscalls.i'. Stop. make[2]: *** [scripts/Makefile.build:480: __build] Error 2 make[1]: *** [Makefile:1760: /home/frdeso/projets/lttng/modules/src] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-67-generic' make: *** [Makefile:32: src/lttng-syscalls.i] Error 2 We see that the gcc tries to create the `src/src/lttng-syscalls.i` file instead of the expected `src/lttng-syscalls.i`. Fix === Remove the `/src` from the `M=` option. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: I4403d32955723239649eb385f877e52cea669720 --- diff --git a/Makefile b/Makefile index 37eb389b..1a30e257 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,9 @@ modules_install: clean: $(MAKE) -C $(KERNELDIR) M=$(PWD)/src clean +# The following target is used for development and debugging. It's not part of +# the build system. %.i: %.c - $(MAKE) -C $(KERNELDIR) M=$(PWD)/src CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m $@ + $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m $@ endif # KERNELRELEASE