Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | # SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
1c8284eb MD |
2 | |
3 | ifneq ($(KERNELRELEASE),) | |
1c8284eb | 4 | |
600da0c9 MJ |
5 | # This part of the Makefile is used when called by the kernel build system |
6 | # and defines the modules to be built. | |
7 | ||
8 | obj-$(CONFIG_LTTNG) += src/ | |
c340f071 | 9 | |
a8907e9a | 10 | else # KERNELRELEASE |
b37d476e | 11 | |
a8907e9a MJ |
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. | |
1c8284eb | 15 | |
a8907e9a MJ |
16 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build |
17 | PWD := $(shell pwd) | |
18 | CFLAGS = $(EXTCFLAGS) | |
1c8284eb | 19 | |
87d1b66f MJ |
20 | default: modules |
21 | ||
22 | modules: | |
600da0c9 | 23 | $(MAKE) -C $(KERNELDIR) M=$(PWD)/src CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules |
1c8284eb MD |
24 | |
25 | modules_install: | |
600da0c9 | 26 | $(MAKE) -C $(KERNELDIR) M=$(PWD)/src CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules_install |
1c8284eb MD |
27 | |
28 | clean: | |
600da0c9 | 29 | $(MAKE) -C $(KERNELDIR) M=$(PWD)/src clean |
1c8284eb | 30 | |
cc422983 FD |
31 | # The following targets are used for development and debugging. They are not |
32 | # part of the build system. | |
23e6a44f | 33 | %.i: %.c |
4e16f2ee | 34 | $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m $@ |
a8907e9a | 35 | |
cc422983 FD |
36 | %.o: %.c |
37 | $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m $@ | |
38 | ||
b4809588 | 39 | endif # KERNELRELEASE |