Skip to contentSkip to conversation

Fix: Use kbuild env instead of a custom var KERNELDIR

PATCH Mathieu Desnoyers 1 participant 1 message Feb 9, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mathieu Desnoyers

author Applied
#1 lore raw

merged, thanks!

Mathieu

Quoted 66 lines · ----- On Feb 8, 2016, at 4:33 PM, Michael Jeanson [email protected] wrote:

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.

---
Makefile | 9 ++++-----
Makefile.ABI.workarounds | 4 ++--

2 files changed, 6 insertions(+), 7 deletions(-)
Makefile +0 -1
index 64d5885..6a8c5c7 100644
@@ -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:

Makefile +0 -1
-	LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m

modules

Makefile +1 -0
+	$(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m modules

modules_install:

Makefile +1 -1
-	LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
+	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:

Makefile +1 -1
-	LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

%.i: %.c

Makefile +1 -1
-	LTTNG_KERNELDIR=$(KERNELDIR) $(MAKE) -C $(KERNELDIR) M=$(PWD) $@
+	$(MAKE) -C $(KERNELDIR) M=$(PWD) $@

endif # KERNELRELEASE

Makefile.ABI.workarounds +1 -1
index e8cf520..f766bc9 100644
@@ -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

Makefile.ABI.workarounds +1 -1
-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.7.0

Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com