summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2012-05-22 16:54:12 +0100
committerJon Medhurst <tixy@linaro.org>2013-10-28 15:03:17 -0700
commit763122c0a2cccd3893749d491f624a0286b992db (patch)
tree1c3ccb513fa485a6a43ba2bb57ba55ab535f0f7f /drivers
parent234d3a4b114a534e0859ca1f888f62b8527d6c8a (diff)
gator: Get Makefile to work with DKMS
DKMS uses an absolute paths for $(src) and $(obj) whereas these are relative paths for other kernel building scenarios. So we need to do some jiggery-pokery to get the rule for gator_events.h to work in all situations. Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gator/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gator/Makefile b/drivers/gator/Makefile
index 2689967a419d..942e415677bd 100644
--- a/drivers/gator/Makefile
+++ b/drivers/gator/Makefile
@@ -3,6 +3,7 @@ ifneq ($(KERNELRELEASE),)
# Uncomment the following line to enable kernel stack unwinding within gator, or update gator_backtrace.c
# EXTRA_CFLAGS += -DGATOR_KERNEL_STACK_UNWINDING
+CONFIG_GATOR ?= m
obj-$(CONFIG_GATOR) := gator.o
gator-y := gator_main.o \
@@ -43,16 +44,21 @@ gator-$(CONFIG_ARM) += gator_events_armv6.o \
gator-$(CONFIG_ARM64) += gator_events_ccn-504.o
-$(obj)/gator_main.o: gator_events.h
+$(obj)/gator_main.o: $(obj)/gator_events.h
clean-files := gator_events.h
+# Note, in the recipe below we use "cd $(srctree) && cd $(src)" rather than
+# "cd $(srctree)/$(src)" because under DKMS $(src) is an absolute path, and we
+# can't just use $(src) because for normal kernel builds this is relative to
+# $(srctree)
+
chk_events.h = :
quiet_chk_events.h = echo ' CHK $@'
silent_chk_events.h = :
-gator_events.h: FORCE
+$(obj)/gator_events.h: FORCE
@$($(quiet)chk_events.h)
- $(Q)cd $(srctree)/$(src) ; $(CONFIG_SHELL) gator_events.sh $(objtree)/$(obj)/$@
+ $(Q)cd $(srctree) && cd $(src) ; $(CONFIG_SHELL) gator_events.sh $(abspath $@)
else