1 ifneq ($(KERNELRELEASE),)
3 # Uncomment the following line to enable kernel stack unwinding within gator, or update gator_backtrace.c
4 # EXTRA_CFLAGS += -DGATOR_KERNEL_STACK_UNWINDING
6 CONFIG_GATOR ?= m
7 obj-$(CONFIG_GATOR) := gator.o
9 gator-y := gator_main.o \
10 gator_events_irq.o \
11 gator_events_sched.o \
12 gator_events_net.o \
13 gator_events_block.o \
14 gator_events_meminfo.o \
15 gator_events_perf_pmu.o \
16 gator_events_mmapped.o \
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_T6xx)
22 CONFIG_GATOR_MALI_4XXMP := n
23 CONFIG_GATOR_MALI_T6XX := y
24 else
25 CONFIG_GATOR_MALI_4XXMP := y
26 CONFIG_GATOR_MALI_T6XX := 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
34 ifeq ($(CONFIG_GATOR_WITH_MALI_SUPPORT),y)
35 ifeq ($(CONFIG_GATOR_MALI_T6XX),y)
36 gator-y += gator_events_mali_t6xx.o \
37 gator_events_mali_t6xx_hw.o
38 include $(src)/mali_t6xx.mk
39 else
40 gator-y += gator_events_mali_4xx.o
41 endif
42 gator-y += gator_events_mali_common.o
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_T6XX) += -DMALI_SUPPORT=MALI_T6xx
49 endif
51 # GATOR_TEST controls whether to include (=1) or exclude (=0) test code.
52 GATOR_TEST ?= 0
53 EXTRA_CFLAGS += -DGATOR_TEST=$(GATOR_TEST)
55 gator-$(CONFIG_ARM) += gator_events_armv6.o \
56 gator_events_armv7.o \
57 gator_events_ccn-504.o \
58 gator_events_l2c-310.o \
59 gator_events_scorpion.o
61 gator-$(CONFIG_ARM64) += gator_events_ccn-504.o
63 else
65 all:
66 @echo
67 @echo "usage:"
68 @echo " make -C <kernel_build_dir> M=\`pwd\` ARCH=arm CROSS_COMPILE=<...> modules"
69 @echo
70 $(error)
72 clean:
73 rm -f *.o .*.cmd modules.order Module.symvers gator.ko gator.mod.c
74 rm -rf .tmp_versions
76 endif