From ebc53e0295274a8d0e04ec87aaab0933d8075cc4 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 8 Feb 2016 16:33:17 -0500 Subject: [PATCH] Fix: Use kbuild env instead of a custom var KERNELDIR We currently use the custom variables KERNELDIR and LTTNG_KERNELDIR to pass the kernel source tree directory to helper scripts. We should instead use the built-in Kbuild variable CURDIR which is available in all sub makefiles and always points to the kernel sources. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- Makefile | 9 ++++----- Makefile.ABI.workarounds | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 64d58850..6a8c5c74 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,6 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_TRACEPOINTS),) - KERNELDIR = ${LTTNG_KERNELDIR} MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST))) lttng_check_linux_version = $(shell pwd)/include/linux/version.h @@ -101,15 +100,15 @@ PWD := $(shell pwd) CFLAGS = $(EXTCFLAGS) default: - LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m modules + $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m modules modules_install: - LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install clean: - LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) clean + $(MAKE) -C $(KERNELDIR) M=$(PWD) clean %.i: %.c - LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) $@ + $(MAKE) -C $(KERNELDIR) M=$(PWD) $@ endif # KERNELRELEASE diff --git a/Makefile.ABI.workarounds b/Makefile.ABI.workarounds index e8cf520a..f766bc93 100644 --- a/Makefile.ABI.workarounds +++ b/Makefile.ABI.workarounds @@ -4,13 +4,13 @@ # the kernel EXTRAVERSION to figure it out. Translate this information # into a define visible from the C preprocessor. -DEB_API_VERSION:=$(shell $(MAKEFILEDIR)/abi-debian-version.sh $(KERNELDIR)) +DEB_API_VERSION:=$(shell $(MAKEFILEDIR)/abi-debian-version.sh $(CURDIR)) ifneq ($(DEB_API_VERSION), 0) ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION) endif -RT_PATCH_VERSION:=$(shell $(MAKEFILEDIR)/rt-patch-version.sh $(KERNELDIR)) +RT_PATCH_VERSION:=$(shell $(MAKEFILEDIR)/rt-patch-version.sh $(CURDIR)) ifneq ($(RT_PATCH_VERSION), 0) ccflags-y += -DRT_PATCH_VERSION=$(RT_PATCH_VERSION) -- 2.34.1