blob: 5ea7f33fb25550d5d53b8c9d056991d1eceb8f0d [file] [log] [blame]
ifneq ($(MET_DRIVER_DIR),)
MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
MET_COMMON_DIR := $(MET_DRIVER_DIR)/common
MET_PLF_DIR := $(MET_DRIVER_DIR)/$(MTK_PLATFORM)
MET_BUILD_DEFAULT := n
ifneq ($(KERNEL_OUT),)
include $(KERNEL_OUT)/.config
ccflags-y += -imacros $(KERNEL_OUT)/include/generated/autoconf.h
endif
ifeq ($(CONFIG_MODULES),y)
ifeq ($(CONFIG_FTRACE),y)
ifeq ($(CONFIG_TRACING),y)
FTRACE_READY := y
endif
endif
$(info ******** Start to build met_drv for $(MTK_PLATFORM) ********)
ifneq ($(MET_PLF_DIR),)
ifeq ($(FTRACE_READY),y)
ifeq ($(CONFIG_BUILD_YOCTO),y)
include $(MET_COMMON_DIR)/Kbuild.yocto
else
include $(MET_COMMON_DIR)/Kbuild
endif
else
$(warning Not building met.ko due to CONFIG_FTRACE/CONFIG_TRACING is not set, build met default)
MET_BUILD_DEFAULT = y
endif
else
$(warning not support $(MTK_PLATFORM), build met default)
MET_BUILD_DEFAULT = y
endif
else
$(warning Not building met.ko due to CONFIG_MODULES is not set, build met default)
MET_BUILD_DEFAULT := y
endif
ifeq ($(MET_BUILD_DEFAULT),y)
MET_DEF_DIR := $(MET_DRIVER_DIR)/default
ifeq ($(CONFIG_BUILD_YOCTO),y)
include $(MET_DEF_DIR)/Kbuild.yocto
else
include $(MET_DEF_DIR)/Kbuild
endif
endif
else
$(info ******** MET_DRIVER_DIR is empty ********)
endif