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
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