aboutsummaryrefslogtreecommitdiff
path: root/driver/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'driver/Makefile')
-rw-r--r--driver/Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/driver/Makefile b/driver/Makefile
index 28d2070..c4c4e6f 100644
--- a/driver/Makefile
+++ b/driver/Makefile
@@ -14,6 +14,7 @@ gator-y := gator_main.o \
gator_events_net.o \
gator_events_perf_pmu.o \
gator_events_sched.o \
+ gator_src_md5.o \
# Convert the old GATOR_WITH_MALI_SUPPORT to the new kernel flags
ifneq ($(GATOR_WITH_MALI_SUPPORT),)
@@ -63,6 +64,20 @@ gator-$(CONFIG_ARM) += gator_events_armv6.o \
gator-$(CONFIG_ARM64) +=
+clean-files := gator_src_md5.c
+
+# 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 = :
+$(obj)/gator_src_md5.c: FORCE
+ @$($(quiet)chk_events.h)
+ $(Q)cd $(srctree) && cd $(src) ; $(CONFIG_SHELL) -c "echo 'char *gator_src_md5 = \"'\`ls *.c *.h mali/*.h | grep -Ev '^(gator_src_md5\.c|gator\.mod\.c)$$' | LC_ALL=C sort | xargs cat | md5sum | cut -b 1-32\`'\";'" > $(@F)
+
else
all:
@@ -73,7 +88,7 @@ all:
$(error)
clean:
- rm -f *.o .*.cmd modules.order Module.symvers gator.ko gator.mod.c
+ rm -f *.o .*.cmd gator_src_md5.c modules.order Module.symvers gator.ko gator.mod.c
rm -rf .tmp_versions
endif