1 # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
3 ifneq ($(KERNELRELEASE
),)
5 # This part of the Makefile is used when called by the kernel build system
6 # and defines the modules to be built.
8 obj-
$(CONFIG_LTTNG
) += src
/
12 # This part of the Makefile is used when the 'make' command is runned in the
13 # base directory of the lttng-modules sources. It sets some environment and
14 # calls the kernel build system to build the actual modules.
16 KERNELDIR ?
= /lib
/modules
/$(shell uname
-r
)/build
19 # Experimental bitwise enum defaults to disabled.
20 CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM ?
= n
22 # Emulate Kconfig behavior of setting defines for config options.
23 LKCPPFLAGS
= $(KCPPFLAGS
)
24 ifeq ($(CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
),y
)
25 LKCPPFLAGS
+= -DCONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
=y
31 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
)/src \
32 CONFIG_LTTNG
=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST
=m \
33 KCPPFLAGS
='$(LKCPPFLAGS)' \
37 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
)/src \
38 CONFIG_LTTNG_SYSCALLS_EXTRACTOR
=m \
39 CONFIG_LTTNG
=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST
=m \
40 KCPPFLAGS
='$(LKCPPFLAGS)' \
44 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
)/src \
45 CONFIG_LTTNG
=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST
=m \
46 KCPPFLAGS
='$(LKCPPFLAGS)' \
50 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
)/src
clean
52 # The following targets are used for development and debugging. They are not
53 # part of the build system.
55 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) \
56 CONFIG_LTTNG
=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST
=m \
57 KCPPFLAGS
='$(LKCPPFLAGS)' \
61 $(MAKE
) -C
$(KERNELDIR
) M
=$(PWD
) \
62 CONFIG_LTTNG
=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST
=m \
63 KCPPFLAGS
='$(LKCPPFLAGS)' \