Fix: Makefile: generation of specific .i file not working
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 30 Apr 2021 15:14:20 +0000 (11:14 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 30 Apr 2021 19:49:36 +0000 (15:49 -0400)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I4403d32955723239649eb385f877e52cea669720

Makefile

index 37eb389b4771a12331e5a85e28b59ecb99c154ea..1a30e2579815269675b30e5e2d0dd6303771c508 100644 (file)
--- 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
This page took 0.03022 seconds and 4 git commands to generate.