Merge branch 'linux-3.10.y' of git://git.kernel.org/pub/scm/linux/kernel/git/stable...
[firefly-linux-kernel-4.4.55.git] / drivers / gator / Makefile
1 ifneq ($(KERNELRELEASE),)
2
3 # Uncomment the following line to enable kernel stack unwinding within gator, or update gator_backtrace.c
4 # EXTRA_CFLAGS +=       -DGATOR_KERNEL_STACK_UNWINDING
5
6 CONFIG_GATOR ?= m
7 obj-$(CONFIG_GATOR) := gator.o
8
9 gator-y :=      gator_main.o \
10                 gator_events_block.o \
11                 gator_events_irq.o \
12                 gator_events_meminfo.o \
13                 gator_events_mmapped.o \
14                 gator_events_net.o \
15                 gator_events_perf_pmu.o \
16                 gator_events_sched.o \
17
18 # Convert the old GATOR_WITH_MALI_SUPPORT to the new kernel flags
19 ifneq ($(GATOR_WITH_MALI_SUPPORT),)
20   CONFIG_GATOR_WITH_MALI_SUPPORT := y
21   ifeq ($(GATOR_WITH_MALI_SUPPORT),MALI_MIDGARD)
22     CONFIG_GATOR_MALI_4XXMP := n
23     CONFIG_GATOR_MALI_MIDGARD := y
24   else
25     CONFIG_GATOR_MALI_4XXMP := y
26     CONFIG_GATOR_MALI_MIDGARD := n
27   endif
28   EXTRA_CFLAGS += -DMALI_SUPPORT=$(GATOR_WITH_MALI_SUPPORT)
29   ifneq ($(GATOR_MALI_INTERFACE_STYLE),)
30     EXTRA_CFLAGS += -DGATOR_MALI_INTERFACE_STYLE=$(GATOR_MALI_INTERFACE_STYLE)
31   endif
32 endif
33
34 ifeq ($(CONFIG_GATOR_WITH_MALI_SUPPORT),y)
35   ifeq ($(CONFIG_GATOR_MALI_MIDGARD),y)
36     gator-y +=  gator_events_mali_midgard.o \
37                 gator_events_mali_midgard_hw.o
38     include $(src)/mali_midgard.mk
39   else
40     gator-y +=  gator_events_mali_4xx.o
41   endif
42   gator-y +=    gator_events_mali_common.o
43
44   ifneq ($(CONFIG_GATOR_MALI_PATH),)
45     ccflags-y += -I$(CONFIG_GATOR_MALI_PATH)
46   endif
47   ccflags-$(CONFIG_GATOR_MALI_4XXMP) += -DMALI_SUPPORT=MALI_4xx
48   ccflags-$(CONFIG_GATOR_MALI_MIDGARD) += -DMALI_SUPPORT=MALI_MIDGARD
49 endif
50
51 # GATOR_TEST controls whether to include (=1) or exclude (=0) test code.
52 GATOR_TEST ?= 0
53 EXTRA_CFLAGS += -DGATOR_TEST=$(GATOR_TEST)
54
55 # Should the original or new block_rq_complete API be used?
56 OLD_BLOCK_RQ_COMPLETE := $(shell grep -A3 block_rq_complete $(srctree)/include/trace/events/block.h | grep nr_bytes -q; echo $$?)
57 EXTRA_CFLAGS += -DOLD_BLOCK_RQ_COMPLETE=$(OLD_BLOCK_RQ_COMPLETE)
58
59 gator-$(CONFIG_ARM) +=  gator_events_armv6.o \
60                         gator_events_armv7.o \
61                         gator_events_l2c-310.o \
62                         gator_events_scorpion.o
63
64 gator-$(CONFIG_ARM64) +=
65
66 $(obj)/gator_main.o: $(obj)/gator_src_md5.h
67
68 clean-files := gator_src_md5.h
69
70 # Note, in the recipe below we use "cd $(srctree) && cd $(src)" rather than
71 # "cd $(srctree)/$(src)" because under DKMS $(src) is an absolute path, and we
72 # can't just use $(src) because for normal kernel builds this is relative to
73 # $(srctree)
74
75        chk_events.h = :
76  quiet_chk_events.h = echo '  CHK     $@'
77 silent_chk_events.h = :
78 $(obj)/gator_src_md5.h: FORCE
79         @$($(quiet)chk_events.h)
80         $(Q)cd $(srctree) && cd $(src) ; $(CONFIG_SHELL) -c "echo 'static 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\`'\";'" > $(abspath $@)
81
82 else
83
84 all:
85         @echo
86         @echo "usage:"
87         @echo "      make -C <kernel_build_dir> M=\`pwd\` ARCH=arm CROSS_COMPILE=<...> modules"
88         @echo
89         $(error)
90
91 clean:
92         rm -f *.o .*.cmd gator_src_md5.h modules.order Module.symvers gator.ko gator.mod.c
93         rm -rf .tmp_versions
94
95 endif