From 91a383b227f148b9371517661e95983ef0726946 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 4 Mar 2020 15:06:41 -0500 Subject: [PATCH] Add a Makefile for the lttng-syscalls-extractor module Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: I0c1cc650d8594ef01b4039bb3d2af94bfddea54d --- .../syscalls/lttng-syscalls-extractor/Kbuild | 5 --- .../lttng-syscalls-extractor/Makefile | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 5 deletions(-) delete mode 100644 instrumentation/syscalls/lttng-syscalls-extractor/Kbuild create mode 100644 instrumentation/syscalls/lttng-syscalls-extractor/Makefile 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 -- 2.34.1