rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | $(info ======== Build met.ko ... ========) |
| 2 | |
| 3 | |
| 4 | MET_CORE := common |
| 5 | obj-m := met.o |
| 6 | ccflags-y += -I$(srctree)/include/ |
| 7 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/ |
| 8 | ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include/ |
| 9 | ccflags-y += -I$(srctree)/../vendor/mediatek/kernel_modules/met_drv/4.9/common/ |
| 10 | ccflags-y += -I$(srctree)/../vendor/mediatek/kernel_modules/met_drv/4.9/$(MTK_PLATFORM)/ |
| 11 | ccflags-y += $(EXTRA_ARGS) $(EXTRA_CFLAGS) |
| 12 | |
| 13 | met-y := $(MET_CORE)/met_main.o \ |
| 14 | $(MET_CORE)/interface.o \ |
| 15 | $(MET_CORE)/sampler.o \ |
| 16 | $(MET_CORE)/util.o \ |
| 17 | $(MET_CORE)/core_plf_init.o \ |
| 18 | $(MET_CORE)/core_plf_trace.o \ |
| 19 | $(MET_CORE)/ondiemet.o \ |
| 20 | $(MET_CORE)/ondiemet_log.o \ |
| 21 | $(MET_CORE)/sspm/ondiemet_sspm.o |
| 22 | |
| 23 | #CFLAGS_interface.o += -DMET_USER_EVENT_SUPPORT |
| 24 | #CFLAGS_met_tag_ex.o += -DMET_USER_EVENT_SUPPORT |
| 25 | |
| 26 | $(info ARCH = $(ARCH)) |
| 27 | ifeq ($(ARCH), mips) |
| 28 | met-y += $(MET_CORE)/mips_pmu_hw.o |
| 29 | endif #ifeq ($(ARCH), mips) |
| 30 | |
| 31 | ifeq ($(ARCH), arm) |
| 32 | ccflags-y += -DCONFIG_MET_ARM_32BIT |
| 33 | met-y += $(MET_CORE)/cpu_pmu.o |
| 34 | met-y += $(MET_CORE)/v7_pmu_hw.o |
| 35 | met-y += $(MET_CORE)/v6_pmu_hw.o |
| 36 | endif #ifeq ($(ARCH), arm) |
| 37 | |
| 38 | ifeq ($(ARCH), arm64) |
| 39 | ccflags-y += -DMET_SUPPORT_CPUPMU_V2 |
| 40 | met-y += $(MET_CORE)/cpu_pmu.o |
| 41 | met-y += $(MET_CORE)/v8_pmu_hw.o |
| 42 | met-y += $(MET_CORE)/cpu_pmu_v2.o |
| 43 | met-y += $(MET_CORE)/v8_pmu_hw_v2.o |
| 44 | endif |
| 45 | |
| 46 | $(info CONFIG_CPU_FREQ = $(CONFIG_CPU_FREQ)) |
| 47 | ifeq ($(CONFIG_CPU_FREQ),y) |
| 48 | met-y += $(MET_CORE)/power.o |
| 49 | endif |
| 50 | |
| 51 | ################################################################################ |
| 52 | # MET_EMI |
| 53 | ################################################################################ |
| 54 | MET_EMI := y |
| 55 | |
| 56 | met-$(MET_EMI) += $(MET_CORE)/met_emi.o $(MET_CORE)/mtk_emi_bm.o |
| 57 | |
| 58 | ################################################################################ |
| 59 | # MET_GPU |
| 60 | ################################################################################ |
| 61 | MET_GPU := y |
| 62 | |
| 63 | met-$(MET_GPU) += $(MET_CORE)/mtk_gpu_metmonitor.o |
| 64 | |
| 65 | |
| 66 | ccflags-y += $(foreach v, $(filter MET_%,$(.VARIABLES)), $(if $(filter $($(v)),y),-D$(v))) |