| $(info ======== Build met.ko ... ========) |
| |
| |
| MET_CORE := common |
| obj-m := met.o |
| ccflags-y += -I$(srctree)/include/ |
| ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/ |
| ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include/ |
| ccflags-y += -I$(srctree)/../vendor/mediatek/kernel_modules/met_drv/4.9/common/ |
| ccflags-y += -I$(srctree)/../vendor/mediatek/kernel_modules/met_drv/4.9/$(MTK_PLATFORM)/ |
| ccflags-y += $(EXTRA_ARGS) $(EXTRA_CFLAGS) |
| |
| met-y := $(MET_CORE)/met_main.o \ |
| $(MET_CORE)/interface.o \ |
| $(MET_CORE)/sampler.o \ |
| $(MET_CORE)/util.o \ |
| $(MET_CORE)/core_plf_init.o \ |
| $(MET_CORE)/core_plf_trace.o \ |
| $(MET_CORE)/ondiemet.o \ |
| $(MET_CORE)/ondiemet_log.o \ |
| $(MET_CORE)/sspm/ondiemet_sspm.o |
| |
| #CFLAGS_interface.o += -DMET_USER_EVENT_SUPPORT |
| #CFLAGS_met_tag_ex.o += -DMET_USER_EVENT_SUPPORT |
| |
| $(info ARCH = $(ARCH)) |
| ifeq ($(ARCH), mips) |
| met-y += $(MET_CORE)/mips_pmu_hw.o |
| endif #ifeq ($(ARCH), mips) |
| |
| ifeq ($(ARCH), arm) |
| ccflags-y += -DCONFIG_MET_ARM_32BIT |
| met-y += $(MET_CORE)/cpu_pmu.o |
| met-y += $(MET_CORE)/v7_pmu_hw.o |
| met-y += $(MET_CORE)/v6_pmu_hw.o |
| endif #ifeq ($(ARCH), arm) |
| |
| ifeq ($(ARCH), arm64) |
| ccflags-y += -DMET_SUPPORT_CPUPMU_V2 |
| met-y += $(MET_CORE)/cpu_pmu.o |
| met-y += $(MET_CORE)/v8_pmu_hw.o |
| met-y += $(MET_CORE)/cpu_pmu_v2.o |
| met-y += $(MET_CORE)/v8_pmu_hw_v2.o |
| endif |
| |
| $(info CONFIG_CPU_FREQ = $(CONFIG_CPU_FREQ)) |
| ifeq ($(CONFIG_CPU_FREQ),y) |
| met-y += $(MET_CORE)/power.o |
| endif |
| |
| ################################################################################ |
| # MET_EMI |
| ################################################################################ |
| MET_EMI := y |
| |
| met-$(MET_EMI) += $(MET_CORE)/met_emi.o $(MET_CORE)/mtk_emi_bm.o |
| |
| ################################################################################ |
| # MET_GPU |
| ################################################################################ |
| MET_GPU := y |
| |
| met-$(MET_GPU) += $(MET_CORE)/mtk_gpu_metmonitor.o |
| |
| |
| ccflags-y += $(foreach v, $(filter MET_%,$(.VARIABLES)), $(if $(filter $($(v)),y),-D$(v))) |