blob: 5ea7f33fb25550d5d53b8c9d056991d1eceb8f0d [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001ifneq ($(MET_DRIVER_DIR),)
2 MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
3 MET_COMMON_DIR := $(MET_DRIVER_DIR)/common
4 MET_PLF_DIR := $(MET_DRIVER_DIR)/$(MTK_PLATFORM)
5 MET_BUILD_DEFAULT := n
6
7 ifneq ($(KERNEL_OUT),)
8 include $(KERNEL_OUT)/.config
9 ccflags-y += -imacros $(KERNEL_OUT)/include/generated/autoconf.h
10 endif
11
12 ifeq ($(CONFIG_MODULES),y)
13 ifeq ($(CONFIG_FTRACE),y)
14 ifeq ($(CONFIG_TRACING),y)
15 FTRACE_READY := y
16 endif
17 endif
18
19 $(info ******** Start to build met_drv for $(MTK_PLATFORM) ********)
20 ifneq ($(MET_PLF_DIR),)
21 ifeq ($(FTRACE_READY),y)
22 ifeq ($(CONFIG_BUILD_YOCTO),y)
23 include $(MET_COMMON_DIR)/Kbuild.yocto
24 else
25 include $(MET_COMMON_DIR)/Kbuild
26 endif
27 else
28 $(warning Not building met.ko due to CONFIG_FTRACE/CONFIG_TRACING is not set, build met default)
29 MET_BUILD_DEFAULT = y
30 endif
31 else
32 $(warning not support $(MTK_PLATFORM), build met default)
33 MET_BUILD_DEFAULT = y
34 endif
35 else
36 $(warning Not building met.ko due to CONFIG_MODULES is not set, build met default)
37 MET_BUILD_DEFAULT := y
38 endif
39
40 ifeq ($(MET_BUILD_DEFAULT),y)
41 MET_DEF_DIR := $(MET_DRIVER_DIR)/default
42 ifeq ($(CONFIG_BUILD_YOCTO),y)
43 include $(MET_DEF_DIR)/Kbuild.yocto
44 else
45 include $(MET_DEF_DIR)/Kbuild
46 endif
47 endif
48else
49$(info ******** MET_DRIVER_DIR is empty ********)
50endif