From: Michael Jeanson Date: Wed, 4 Mar 2020 20:06:41 +0000 (-0500) Subject: Add a Makefile for the lttng-syscalls-extractor module X-Git-Tag: before-upstreaming~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=91a383b227f148b9371517661e95983ef0726946;p=lttng-modules.git Add a Makefile for the lttng-syscalls-extractor module Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I0c1cc650d8594ef01b4039bb3d2af94bfddea54d --- diff --git a/instrumentation/syscalls/lttng-syscalls-extractor/Kbuild b/instrumentation/syscalls/lttng-syscalls-extractor/Kbuild deleted file mode 100644 index 079aab33..00000000 --- a/instrumentation/syscalls/lttng-syscalls-extractor/Kbuild +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) - -obj-m += lttng-syscalls-extractor.o - -# vim:syntax=make diff --git a/instrumentation/syscalls/lttng-syscalls-extractor/Makefile b/instrumentation/syscalls/lttng-syscalls-extractor/Makefile new file mode 100644 index 00000000..57b908bf --- /dev/null +++ b/instrumentation/syscalls/lttng-syscalls-extractor/Makefile @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) + +ifneq ($(KERNELRELEASE),) + + # This part of the Makefile is used when called by the kernel build system + # and defines the modules to be built. + + obj-m += lttng-syscalls-extractor.o + +else # KERNELRELEASE + +# This part of the Makefile is used when the 'make' command is runned in the +# base directory of the lttng-modules sources. It sets some environment and +# calls the kernel build system to build the actual modules. + +KERNELDIR ?= /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) +CFLAGS = $(EXTCFLAGS) + +default: modules + +modules: + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules + +clean: + $(MAKE) -C $(KERNELDIR) M=$(PWD) clean + +%.i: %.c + $(MAKE) -C $(KERNELDIR) M=$(PWD) $@ + +endif # KERNELRELEASE