rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | ifeq ($(CONFIG_BUILD_YOCTO),y) |
| 2 | MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM)) |
| 3 | MET_ROOT_DIR := $(MET_DRIVER_DIR) |
| 4 | MET_COMMON_DIR := $(MET_DRIVER_DIR)/common |
| 5 | MET_PLF_DIR := $(MET_DRIVER_DIR)/$(MTK_PLATFORM) |
| 6 | MET_BUILD_DEFAULT := n |
| 7 | |
| 8 | ifneq ($(KERNEL_OUT),) |
| 9 | include $(KERNEL_OUT)/.config |
| 10 | ccflags-y += -imacros $(KERNEL_OUT)/include/generated/autoconf.h |
| 11 | endif |
| 12 | else |
| 13 | #$(info TARGET_BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)) |
| 14 | #$(info TARGET_PRODUCT=$(TARGET_PRODUCT)) |
| 15 | #MTK_PLATFORM := $(subst ",,$(TARGET_BOARD_PLATFORM)) |
| 16 | #MTK_PLATFORM := $(TARGET_DEVICE) |
| 17 | MTK_PLATFORM := mt2712 |
| 18 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) |
| 19 | MET_ROOT_DIR := $(patsubst %/,%,$(dir $(mkfile_path))) |
| 20 | MET_COMMON_DIR := $(wildcard $(MET_ROOT_DIR)/common) |
| 21 | MET_PLF_DIR := $(wildcard $(MET_ROOT_DIR)/$(MTK_PLATFORM)) |
| 22 | MET_BUILD_DEFAULT := n |
| 23 | |
| 24 | #$(info MTK_PLATFORM=$(TARGET_DEVICE)) |
| 25 | #$(info mkfile_path=$(mkfile_path)) |
| 26 | #$(info MET_ROOT_DIR=$(MET_ROOT_DIR)) |
| 27 | #$(info MET_COMMON_DIR=$(MET_COMMON_DIR)) |
| 28 | #$(info MET_PLF_DIR=$(MET_PLF_DIR)) |
| 29 | endif |
| 30 | |
| 31 | ifeq ($(CONFIG_MODULES),y) |
| 32 | |
| 33 | ifeq ($(CONFIG_FTRACE),y) |
| 34 | ifeq ($(CONFIG_TRACING),y) |
| 35 | FTRACE_READY := y |
| 36 | endif |
| 37 | endif |
| 38 | |
| 39 | $(info ******** Start to build met_drv for $(MTK_PLATFORM) ********) |
| 40 | ifneq ($(MET_PLF_DIR),) |
| 41 | ifeq ($(FTRACE_READY),y) |
| 42 | ifeq ($(CONFIG_BUILD_YOCTO),y) |
| 43 | include $(MET_COMMON_DIR)/Kbuild.yocto |
| 44 | else |
| 45 | include $(MET_COMMON_DIR)/Kbuild |
| 46 | endif |
| 47 | else |
| 48 | $(warning Not building met.ko due to CONFIG_FTRACE/CONFIG_TRACING is not set, build met default) |
| 49 | MET_BUILD_DEFAULT = y |
| 50 | endif |
| 51 | else |
| 52 | $(warning not support $(MTK_PLATFORM), build met default) |
| 53 | MET_BUILD_DEFAULT = y |
| 54 | endif |
| 55 | else #CONFIG_MODULES = n |
| 56 | $(warning Not building met.ko due to CONFIG_MODULES is not set, build met default) |
| 57 | MET_BUILD_DEFAULT := y |
| 58 | endif |
| 59 | |
| 60 | ifeq ($(MET_BUILD_DEFAULT),y) |
| 61 | MET_DEF_DIR := $(MET_ROOT_DIR)/default |
| 62 | include $(MET_DEF_DIR)/Kbuild |
| 63 | endif |