rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | INC_DIR = |
| 2 | COMP_DEFS = |
| 3 | FOLDER_LIST = |
| 4 | |
| 5 | # Define ./interface/modem folder path by project option |
| 6 | ifneq ($(filter __MD93__,$(strip $(MODULE_DEFS))),) |
| 7 | MD_VER_FOLDER_PATH = mt6293 |
| 8 | else ifneq ($(filter __MD95__,$(strip $(MODULE_DEFS))),) |
| 9 | MD_VER_FOLDER_PATH = mt6295 |
| 10 | else ifneq ($(filter __MD97__,$(strip $(MODULE_DEFS))),) |
| 11 | MD_VER_FOLDER_PATH = mt6297 |
| 12 | else ifneq ($(filter __MD97P__,$(strip $(MODULE_DEFS))),) |
| 13 | MD_VER_FOLDER_PATH = mt6297p |
| 14 | else |
| 15 | #no match chip |
| 16 | endif |
| 17 | # Define source file lists to SRC_LIST |
| 18 | # Define source file folder to FOLDER_LIST |
| 19 | |
| 20 | #service |
| 21 | ifeq ($(strip $(TST_SUPPORT)), TRUE) |
| 22 | FOLDER_LIST += ./custom/service/tst |
| 23 | endif |
| 24 | |
| 25 | ifneq ($(filter __MTK_TARGET__,$(strip $(MODULE_DEFS))),) |
| 26 | FOLDER_LIST += ./custom/service/fs |
| 27 | endif |
| 28 | |
| 29 | FOLDER_LIST += ./custom/service/nvram \ |
| 30 | ./custom/service/common \ |
| 31 | ./custom/service/mcf \ |
| 32 | $(strip $(PROJDIR))/nvram_auto_gen |
| 33 | |
| 34 | |
| 35 | SRC_LIST += $(foreach DIR,$(FOLDER_LIST), \ |
| 36 | $(foreach FILE,$(wildcard $(DIR)/*.c),$(FILE)) \ |
| 37 | ) |
| 38 | SRC_LIST += $(foreach DIR,$(FOLDER_LIST), \ |
| 39 | $(foreach FILE,$(wildcard $(DIR)/*.cpp),$(FILE)) \ |
| 40 | ) |
| 41 | SRC_LIST += $(foreach DIR,$(FOLDER_LIST), \ |
| 42 | $(foreach FILE,$(wildcard $(DIR)/*.s),$(FILE)) \ |
| 43 | ) |
| 44 | SRC_LIST += $(foreach DIR,$(FOLDER_LIST), \ |
| 45 | $(foreach FILE,$(wildcard $(DIR)/*.S),$(FILE)) \ |
| 46 | ) |
| 47 | SRC_LIST += $(foreach DIR,$(FOLDER_LIST), \ |
| 48 | $(foreach FILE,$(wildcard $(DIR)/*.dws),$(FILE)) \ |
| 49 | ) |
| 50 | SRC_LIST += $(foreach DIR,$(FOLDER_LIST), \ |
| 51 | $(foreach FILE,$(wildcard $(DIR)/*.rec),$(FILE)) \ |
| 52 | ) |
| 53 | |
| 54 | # Not compile nl1_nvram_def_md97.c |
| 55 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),nl1_nvram_def_md97.c),,$(file))) |
| 56 | # Not compile el1_nvram_def_md93.c/el1_nvram_def_md95.c |
| 57 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),el1_nvram_def_md93.c),,$(file))) |
| 58 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),el1_nvram_def_md95.c),,$(file))) |
| 59 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),el1_nvram_def_md97.c),,$(file))) |
| 60 | # Not compile mml1_nvram_def_md93.c/mml1_nvram_def_md95.c |
| 61 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),mml1_nvram_def_md93.c),,$(file))) |
| 62 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),mml1_nvram_def_md95.c),,$(file))) |
| 63 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),mml1_nvram_def_md97.c),,$(file))) |
| 64 | # Not compile mmrfc_nvram_def_md97.c |
| 65 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),mmrfc_nvram_def_md97.c),,$(file))) |
| 66 | SRC_LIST := $(call uniq,$(SRC_LIST)) |
| 67 | |
| 68 | ifeq ($(strip $(DHL_SUPPORT)), TRUE) |
| 69 | SRC_LIST += ./custom/service/tst/dhl_export_config.c |
| 70 | SRC_LIST += ./custom/service/tst/dhl_custom_set_log_buf.c |
| 71 | endif |
| 72 | |
| 73 | #only in MoDIS |
| 74 | ifeq ($(filter __MTK_TARGET__, $(strip $(MODULE_DEFS))),) |
| 75 | MODIS_DIS_FILE := custom_emi.c custom_flash.c usb_custom.c wndrv_configure.c wndrv_rf_ah.c wndrv_rf_maxim.c |
| 76 | MODIS_DIS_FILE += custom_flash_norfdm5.c afe.c mal1_create.c kbdmain_joystick.c ERS_api.c ERS_sys.s custom_sfi.c |
| 77 | MODIS_DIS_FILE += combo_flash_init.c combo_flash_nor.c |
| 78 | SRC_LIST := $(foreach file,$(SRC_LIST),$(if $(filter $(notdir $(call Lower,$(file))),$(call Lower,$(MODIS_DIS_FILE))),,$(file))) |
| 79 | endif |
| 80 | |
| 81 | SRC_LIST := $(call uniq,$(SRC_LIST)) |
| 82 | |
| 83 | INC_DIR += ./service/nvram/include \ |
| 84 | ./service/fs/common/include |
| 85 | |
| 86 | |
| 87 | # SV5 |
| 88 | INC_DIR += ./service/sys_svc/gfh/public \ |
| 89 | ./service/sss/interface/inc \ |
| 90 | ./service/sst/include \ |
| 91 | ./service/sst/include |
| 92 | |
| 93 | ifeq ($(filter __MTK_TARGET__,$(strip $(MODULE_DEFS))),) |
| 94 | INC_DIR += MoDIS_VC9/drv_sim/include |
| 95 | endif |
| 96 | |
| 97 | #INC_DIR += ./service/tst/local_inc |
| 98 | # for customize secure |
| 99 | INC_DIR += ./interface/service/sys_svc |
| 100 | |
| 101 | INC_DIR := $(call uniq,$(INC_DIR)) |
| 102 | |
| 103 | |
| 104 | # Define the specified compile options to COMP_DEFS |
| 105 | COMP_DEFS += __UCS2_ENCODING \ |
| 106 | MMI_ON_HARDWARE_P \ |
| 107 | APCS_INTWORK \ |
| 108 | USE_JAM=0 \ |
| 109 | COMPILER_SUPPORTS_LONG=1 |
| 110 | |
| 111 | ifeq ($(filter __NOR_FLASH_BOOTING__,$(strip $(DEFINES))),) |
| 112 | ifdef NEED_BUILD_BOOTLOADER |
| 113 | ifeq ($(strip $(NEED_BUILD_BOOTLOADER)),TRUE) |
| 114 | COMP_DEFS += __BL_ENABLE__ |
| 115 | COMP_DEFS += REMAPPING |
| 116 | endif |
| 117 | endif |
| 118 | endif |
| 119 | |
| 120 | ifeq ($(strip $(ENHANCED_SINGLE_BANK_NOR_FLASH_SUPPORT)),TRUE) |
| 121 | COMP_DEFS += REMAPPING |
| 122 | endif |
| 123 | INC_DIR += interface/l1/el1/external |
| 124 | ifneq ($(filter __MD97__ __MD97P__,$(strip $(MODULE_DEFS))),) |
| 125 | INC_DIR += $(UNIVERSAL_COMMON)/interface/modem/$(MD_VER_FOLDER_PATH)/common/nr/external/custom |
| 126 | INC_DIR += $(UNIVERSAL_COMMON)/interface/modem/$(MD_VER_FOLDER_PATH)/common/nr/external/5g |
| 127 | endif |
| 128 | INC_DIR += interface/l1/nl1/external/4g |
| 129 | INC_DIR += interface/l1/nl1/external/5g |
| 130 | INC_DIR += interface/protocol/general |
| 131 | #fdr_reorg |
| 132 | INC_DIR += interface/protocol/as_c2k/common \ |
| 133 | interface/service/sbp \ |
| 134 | interface/l1/cl1/common \ |
| 135 | interface/protocol/nas_c2k \ |
| 136 | interface/protocol/as_c2k/1xrtt \ |
| 137 | interface/protocol/as_c2k/evdo \ |
| 138 | interface/protocol/l2_c2k/common |
| 139 | |
| 140 | INC_DIR += interface/service/mcf |