Fix: allow LTTng to be built within kernel tree
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 Jul 2015 03:49:15 +0000 (23:49 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 Jul 2015 05:15:50 +0000 (01:15 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile
Makefile.ABI.workarounds
lib/Makefile
probes/Makefile

index f233e660473b8b21167d8ecea5a4b3593fcdd692..7c878f0589209fa893b21a29709091e08e202380 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,11 +5,13 @@
 ifneq ($(KERNELRELEASE),)
 ifneq ($(CONFIG_TRACEPOINTS),)
 
-KERNELDIR=${LTTNG_KERNELDIR}
+KERNELDIR = ${LTTNG_KERNELDIR}
+MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST)))
 
 lttng_check_linux_version = $(shell pwd)/include/linux/version.h
 lttng_check_generated_linux_version = $(shell pwd)/include/generated/uapi/linux/version.h
 
+
 #
 # Check for stale version.h, which can be a leftover from an old Linux
 # kernel tree moved to a newer kernel version, only pruned by make
@@ -21,7 +23,7 @@ $(error Duplicate version.h files found in $(lttng_check_linux_version) and $(lt
 endif
 endif
 
-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
+include $(MAKEFILEDIR)/Makefile.ABI.workarounds
 
 obj-m += lttng-ring-buffer-client-discard.o
 obj-m += lttng-ring-buffer-client-overwrite.o
index f00340c977a2e6398002f81451cdcec14b7554c4..be9f1cb5455ba061bf2cad0917ad45c9efcfed54 100644 (file)
@@ -4,7 +4,7 @@
 # the kernel EXTRAVERSION to figure it out. Translate this information
 # into a define visible from the C preprocessor.
 
-DEB_API_VERSION=$(shell $(KBUILD_EXTMOD)/abi-debian-version.sh $(KERNELDIR))
+DEB_API_VERSION=$(shell $(MAKEFILEDIR)/abi-debian-version.sh $(KERNELDIR))
 
 ifneq ($(DEB_API_VERSION), 0)
 ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION)
index 420c85a5e587a81fd67ccb8d5344287ce4bf01d3..6074406678c1554fe38d3592e88f058c1cdc7291 100644 (file)
@@ -1,6 +1,7 @@
-KERNELDIR=${LTTNG_KERNELDIR}
+KERNELDIR = ${LTTNG_KERNELDIR}
+MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST)))
 
-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
+include $(MAKEFILEDIR)/../Makefile.ABI.workarounds
 
 obj-m += lttng-lib-ring-buffer.o
 
index f0325c875e2cb3f233fdd1c3181794c0e20dc5dd..0314a5e2205679616f015a37dd7ec727fd3f6270 100644 (file)
@@ -5,9 +5,10 @@
 ifneq ($(KERNELRELEASE),)
 ifneq ($(CONFIG_TRACEPOINTS),)
 
-KERNELDIR=${LTTNG_KERNELDIR}
+KERNELDIR = ${LTTNG_KERNELDIR}
+MAKEFILEDIR = $(shell dirname $(lastword $(MAKEFILE_LIST)))
 
-include $(KBUILD_EXTMOD)/Makefile.ABI.workarounds
+include $(MAKEFILEDIR)/../Makefile.ABI.workarounds
 
 ccflags-y += -I$(PWD)/probes
 obj-m += lttng-types.o
This page took 0.043443 seconds and 4 git commands to generate.