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