587 lines
26 KiB
Makefile
587 lines
26 KiB
Makefile
#-------------------------------------------------------------------------------
|
|
# Configure environment path
|
|
#-------------------------------------------------------------------------------
|
|
TOP_DIR:=$(TOP_DIR)
|
|
ROOT_DIR:=$(TOP_DIR)/../..
|
|
BUILD_DIR:=build
|
|
IMAGE_BUILD_DIR:=build
|
|
OBJ_DIR:=$(subst $(strip \),/,$(BUILD_DIR)/obj)
|
|
CUR_MAKEFILE := $(abspath $(firstword $(MAKEFILE_LIST)))
|
|
PACKAGE_PATH:=$(firstword $(dir $(CUR_MAKEFILE)))
|
|
PACKAGE_PARENT_PATH_TMP:=$(dir $(realpath $(PACKAGE_PATH)))
|
|
PACKAGE_PARENT_PATH:=$(patsubst $(subst $(strip \),/,$(PACKAGE_PATH))%,%,$(PACKAGE_PARENT_PATH_TMP))
|
|
PACKAGE_NAME_TMP1=$(lastword $(subst $(strip /), ,$(PACKAGE_PATH)))
|
|
PACKAGE_NAME_TMP2=$(lastword $(subst $(strip /), ,$(PACKAGE_PARENT_PATH)))
|
|
|
|
PACKAGE_NAME:=$(PACKAGE_NAME_TMP1)
|
|
CREATE_BIN_TOOLS_DIR:=$(TOP_DIR)/tools
|
|
##如果是2M的内置FLASH且无外挂FLASH,则CP不分成2个分区[cp.bin一半放在内部FLASH,一半放在外部FLASH]
|
|
ifneq (,$(findstring 2M,${FLASH_SIZE}))
|
|
ifeq (,$(findstring NO_EXTFLASH,${ExtFlashType}))
|
|
IMAGE_GENERAL_INFO:=$(IMAGE_GENERAL_INFO)_TRUNCATE
|
|
endif
|
|
endif
|
|
IMAGE_NAME:=$(IMAGE_GENERAL_INFO).bin
|
|
COMLIED_LIB_LIST_FILE:=$(TOP_DIR)/$(IMAGE_BUILD_DIR)/complied_lib.txt
|
|
COMLIED_PP_LIST_FILE:=$(TOP_DIR)/$(IMAGE_BUILD_DIR)/complied_pp.txt
|
|
TXT_MDB_FILE_NAME:=KERNEL_MDB.txt
|
|
DAIGDB_C_FILE_NAME:=diagDB.c
|
|
ICAT_COMMAND_FILTER:=$(TOP_DIR)/config/mdb/icat_command_filter.pl
|
|
ICAT_COMMAND_FILTER_LIST:=$(TOP_DIR)/config/mdb/icat_command_filter.whitelist
|
|
ICAT_COMMAND_FILTER_PP_DIR:=$(subst $(strip /),\,$(TOP_DIR)/$(IMAGE_BUILD_DIR)/cmd_filter_dir)
|
|
ICAT_COMMAND_FILTER_PP_LIST:=$(subst $(strip /),\,$(TOP_DIR)/$(IMAGE_BUILD_DIR)/cmd_filter_dir/icat_command_filter_pp_list.txt)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Configure source code files to compile in the source code directories
|
|
#-------------------------------------------------------------------------------
|
|
#track多合一编译非GNSS型号,SDK直接裁剪GNSS,不编译
|
|
GPS_MODULES := ASR_GPS CC11XXW_GPS HX_GPS
|
|
ifneq (,$(filter gnss, $(COMMPILE_DIRS)))
|
|
# 遍历GPS_MODULES,检查是否有成员被包含在FLASHTYPE中
|
|
FOUND_MATCH :=
|
|
$(foreach module, $(GPS_MODULES), \
|
|
$(if $(findstring $(module), $(FLASHTYPE)), \
|
|
$(eval FOUND_MATCH := yes) \
|
|
) \
|
|
)
|
|
|
|
# 如果没有找到匹配,则移除gnss
|
|
ifneq (yes, $(FOUND_MATCH))
|
|
COMMPILE_DIRS := $(filter-out gnss, $(COMMPILE_DIRS))
|
|
endif
|
|
endif
|
|
|
|
COMMPILE_DIRS:=$(subst $(strip \),/,$(COMMPILE_DIRS))
|
|
TARGET_COMMPILE_DIRS:=$(patsubst %,%/target_compile_dir,$(COMMPILE_DIRS))
|
|
TARGET_CLEAN_DIRS:=$(patsubst %,%/target_clean_dir,$(COMMPILE_DIRS))
|
|
|
|
SRC_FILES:=$(subst $(strip \),/,$(SRC_FILES))
|
|
SRC_DIRS:=$(dir $(SRC_FILES))
|
|
|
|
OBJS_TMP:= $(SRC_FILES:.c=.o)
|
|
OBJS_TMP:=$(OBJS_TMP:.cpp=.o)
|
|
OBJS_TMP:=$(OBJS_TMP:.cc=.o)
|
|
OBJS_TMP:=$(OBJS_TMP:.cxx=.o)
|
|
OBJS_TMP:=$(OBJS_TMP:.S=.o)
|
|
OBJS_TMP:=$(OBJS_TMP:.s=.o)
|
|
OBJS_TMP:=$(patsubst %,$(subst $(strip \),/,$(OBJ_DIR))/%,$(OBJS_TMP))
|
|
OBJS=$(OBJS_TMP)
|
|
|
|
DEF_FILES_TMP:= $(SRC_FILES:.c=.d)
|
|
DEF_FILES_TMP:=$(DEF_FILES_TMP:.cpp=.d)
|
|
DEF_FILES_TMP:=$(patsubst %,$(subst $(strip \),/,$(OBJ_DIR))/%,$(DEF_FILES_TMP))
|
|
DEF_FILES:=$(DEF_FILES_TMP)
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Configure compiling utilities
|
|
#-------------------------------------------------------------------------------
|
|
CC:=armcc.exe
|
|
ASM:=armasm.exe
|
|
CPP:=armcc.exe
|
|
LD:=armlink.exe
|
|
AR:=armar.exe
|
|
FROMELF:=fromelf.exe
|
|
MAKE:=gnumake.exe
|
|
PERL:=perl.exe
|
|
PPC:=$(TOP_DIR)\tools\prepass\Hermon\Release\PPC.exe
|
|
PPL:=$(TOP_DIR)\tools\prepass\Hermon\Release\PPL.exe
|
|
PPU:=$(TOP_DIR)\tools\prepass\Hermon\Release\PPU.exe
|
|
PPMAN:=$(TOP_DIR)\tools\prepass\Hermon\Release\PPManCmd.exe
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Configure compiling options
|
|
#-------------------------------------------------------------------------------
|
|
DFLAGS += -DNO_AUDIO
|
|
DFLAGS += -DENABLE_HARD_FPU
|
|
MPU_FLAG = --cpu Cortex-R5F --fpu=softvfp+vfpv3_d16
|
|
|
|
ifneq (,$(findstring 1602,${ASR_PLATFORM}))
|
|
LDFLAGS:=--via config/common/common_lib_list_1602.txt \
|
|
--via $(IMAGE_BUILD_DIR)/complied_lib.txt \
|
|
--predefine="-DCRANE_MODULE_SUPPORT" \
|
|
--predefine="-DQUECTEL_OPEN_CPU" \
|
|
--map --symbols --info sizes,totals \
|
|
--keep init.o(Header) \
|
|
--keep init.o(Vectors) \
|
|
--diag_suppress 6312,6314,6319,6329 \
|
|
--feedback=config/common/feedbackLinkOptLteonlyThin.txt
|
|
|
|
include $(TOP_DIR)/config/common/default_dflags_1602.mk
|
|
COMMON_PP_LIST_FILE:=$(TOP_DIR)/config/common/common_pp_list_1602.txt
|
|
|
|
ifneq (,$(findstring 4M,${FLASH_SIZE}))
|
|
LDFLAGS += --elf --scatter config/ram/CraneLR_DS_4M_Ram_4M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANELR_4MRAM"
|
|
ifneq (,$(findstring QUECTEL_SUPPORT_IMSSMS,${DFLAGS}))
|
|
LDFLAGS += --predefine="-DQUECTEL_SUPPORT_IMSSMS"
|
|
endif
|
|
DFLAGS += -ULTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM -UCRANELRH_SUPPORT -DCRANELR_SUPPORT
|
|
endif
|
|
|
|
ifneq (,$(findstring 2M,${FLASH_SIZE}))
|
|
ifneq (,$(findstring QUEC_NOTA,${DFLAGS}))
|
|
LDFLAGS += --elf --scatter config/ram/CraneLR_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM_NOTA.sct \
|
|
--predefine="-DCRANELR_4MRAM"
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM -UCRANELRH_SUPPORT -DCRANELR_SUPPORT
|
|
else
|
|
LDFLAGS += --elf --scatter config/ram/CraneLR_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANELR_4MRAM"
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM -UCRANELRH_SUPPORT -DCRANELR_SUPPORT
|
|
endif
|
|
endif
|
|
LDFLAGS += --predefine="-DCRANELR_SUPPORT"
|
|
ifneq (,$(findstring ENABLE_WIFI_SCAN,${DFLAGS}))
|
|
LDFLAGS += --predefine="-DL1_WIFI_LOCATION"
|
|
endif
|
|
LIB_DIR_NAME:=lib_1602
|
|
endif
|
|
|
|
ifneq (,$(findstring 1605,${ASR_PLATFORM}))
|
|
# 1605与1602共库
|
|
LDFLAGS:=--via config/common/common_lib_list_1602.txt \
|
|
--via $(IMAGE_BUILD_DIR)/complied_lib.txt \
|
|
--predefine="-DCRANE_MODULE_SUPPORT" \
|
|
--predefine="-DQUECTEL_OPEN_CPU" \
|
|
--map --symbols --info sizes,totals \
|
|
--keep init.o(Header) \
|
|
--keep init.o(Vectors) \
|
|
--diag_suppress 6312,6314,6319,6329 \
|
|
--feedback=config/common/feedbackLinkOptLteonlyThin.txt
|
|
|
|
include $(TOP_DIR)/config/common/default_dflags_1602.mk
|
|
COMMON_PP_LIST_FILE:=$(TOP_DIR)/config/common/common_pp_list_1602.txt
|
|
|
|
ifneq (,$(findstring 4M,${FLASH_SIZE}))
|
|
# 1605使用1602的sct文件,sct文件包含一个头文件
|
|
# 该头文件有MSA_SIZE宏用于调整分区大小,作用于sct文件,所以需要LDFLAGS(链接宏)去控制
|
|
# CRANELRH_4MRAM宏暂时没用
|
|
LDFLAGS += --elf --scatter config/ram/CraneLR_DS_4M_Ram_4M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANELRH_4MRAM"
|
|
ifneq (,$(findstring QUECTEL_SUPPORT_IMSSMS,${DFLAGS}))
|
|
LDFLAGS += --predefine="-DQUECTEL_SUPPORT_IMSSMS"
|
|
endif
|
|
DFLAGS += -ULTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM -UCRANELR_SUPPORT -DCRANELRH_SUPPORT
|
|
endif
|
|
ifneq (,$(findstring 2M,${FLASH_SIZE}))
|
|
ifneq (,$(findstring QUEC_NOTA,${DFLAGS}))
|
|
LDFLAGS += --elf --scatter config/ram/CraneLR_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM_NOTA.sct \
|
|
--predefine="-DCRANELR_4MRAM"
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM -UCRANELR_SUPPORT -DCRANELRH_SUPPORT
|
|
else
|
|
LDFLAGS += --elf --scatter config/ram/CraneLR_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANELR_4MRAM"
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM -UCRANELR_SUPPORT -DCRANELRH_SUPPORT
|
|
endif
|
|
endif
|
|
LDFLAGS += --predefine="-DCRANELRH_SUPPORT"
|
|
LIB_DIR_NAME:=lib_1602
|
|
endif
|
|
|
|
ifneq (,$(findstring 1603,${ASR_PLATFORM}))
|
|
COMMON_PP_LIST_FILE:=$(TOP_DIR)/config/common/common_pp_list_1603.txt
|
|
include $(TOP_DIR)/config/common/default_dflags_1603.mk
|
|
LDFLAGS:= --via config/common/common_lib_list_1603.txt \
|
|
--via $(IMAGE_BUILD_DIR)/complied_lib.txt \
|
|
--elf --map --symbols --info sizes,totals \
|
|
--keep init.o(Header) \
|
|
--keep init.o(Vectors) \
|
|
--diag_suppress 6312,6314,6319,6329 \
|
|
--feedback=config/common/feedbackLinkOptLteonlyThin.txt
|
|
LDFLAGS += --predefine="-DQUECTEL_OPEN_CPU" \
|
|
--predefine="-DCRANEM_SUPPORT"
|
|
|
|
ifneq (,$(findstring 8M,${FLASH_SIZE}))
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
|
|
ifneq (,$(findstring 8M,${RAM_SIZE}))
|
|
DFLAGS += -UCRANEM_16MRAM
|
|
LDFLAGS += --scatter config/ram/CraneM_DS_8M_Ram_8M_Flash_XIP_CIPSRAM_Common.sct
|
|
else
|
|
DFLAGS += -DCRANEM_16MRAM
|
|
LDFLAGS += --scatter config/ram/CraneM_DS_16M_Ram_8M_Flash_XIP_CIPSRAM_Common.sct
|
|
endif
|
|
endif
|
|
|
|
# 1603不支持hard fpu
|
|
DFLAGS += -UENABLE_HARD_FPU
|
|
MPU_FLAG = --cpu Cortex-R4 --fpu=softvfp
|
|
|
|
LIB_DIR_NAME:=lib_1603
|
|
endif
|
|
|
|
ifneq (,$(findstring 1606,${ASR_PLATFORM}))
|
|
LDFLAGS:=--via config/common/common_lib_list_1606.txt \
|
|
--via $(IMAGE_BUILD_DIR)/complied_lib.txt \
|
|
--predefine="-DCRANE_MODULE_SUPPORT" \
|
|
--predefine="-DQUECTEL_OPEN_CPU" \
|
|
--map --symbols --info sizes,totals \
|
|
--keep init.o(Header) \
|
|
--keep init.o(Vectors) \
|
|
--diag_suppress 6312,6314,6319,6329 \
|
|
--feedback=config/common/feedbackLinkOptLteonlyThin.txt
|
|
|
|
include $(TOP_DIR)/config/common/default_dflags_1606.mk
|
|
COMMON_PP_LIST_FILE:=$(TOP_DIR)/config/common/common_pp_list_1606.txt
|
|
|
|
ifneq (,$(findstring 8M,${FLASH_SIZE}))
|
|
LDFLAGS += --elf --scatter config/ram/Crane_DS_8M_Ram_8M_Flash_XIP_CIPSRAM_Common.sct \
|
|
--predefine="-DCRANEL_8MRAM"
|
|
DFLAGS += -ULTEONLY_THIN_SINGLE_SIM_2MFLASH -DCRANEL_8MRAM -DLTEONLY_8M8M -UCRANEL_4MRAM
|
|
DFLAGS += -UREDUCE_SULOG_IRBUF_DSP -DNOT_REDUCE_SULOG_DSP
|
|
endif
|
|
|
|
ifneq (,$(findstring 4M,${FLASH_SIZE}))
|
|
LDFLAGS += --elf --scatter config/ram/Crane_DS_4M_Ram_4M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANEL_4MRAM"
|
|
DFLAGS += -ULTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM
|
|
endif
|
|
|
|
ifneq (,$(findstring 2M,${FLASH_SIZE}))
|
|
ifneq (,$(findstring QUEC_NOTA,${DFLAGS}))
|
|
ifeq (,$(findstring NO_EXTFLASH,${ExtFlashType}))
|
|
LDFLAGS += --elf --scatter config/ram/Crane_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANEL_4MRAM"
|
|
DFLAGS += -DQUEC_NOTA_EXT_FLASH_SUPPORT
|
|
else
|
|
LDFLAGS += --elf --scatter config/ram/Crane_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM_NOTA.sct \
|
|
--predefine="-DCRANEL_4MRAM"
|
|
endif
|
|
else
|
|
LDFLAGS += --elf --scatter config/ram/Crane_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \
|
|
--predefine="-DCRANEL_4MRAM"
|
|
endif
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -UCRANEL_8MRAM -ULTEONLY_8M8M -DCRANEL_4MRAM
|
|
endif
|
|
LIB_DIR_NAME:=lib_1606
|
|
endif
|
|
|
|
ifneq (,$(findstring 1609,${ASR_PLATFORM}))
|
|
LDFLAGS:=--via config/common/common_lib_list_1609.txt \
|
|
--via $(IMAGE_BUILD_DIR)/complied_lib.txt \
|
|
--predefine="-DL1_WIFI_LOCATION" \
|
|
--predefine="-DCRANE_MODULE_SUPPORT" \
|
|
--predefine="-DQUECTEL_OPEN_CPU" \
|
|
--map --symbols --info sizes,totals \
|
|
--keep init.o(Header) \
|
|
--keep init.o(Vectors) \
|
|
--diag_suppress 6312,6314,6319,6329 \
|
|
--feedback=config/common/feedbackLinkOptLteonlyThin.txt
|
|
|
|
include $(TOP_DIR)/config/common/default_dflags_1609.mk
|
|
COMMON_PP_LIST_FILE:=$(TOP_DIR)/config/common/common_pp_list_1609.txt
|
|
|
|
ifneq (,$(findstring 8M,${FLASH_SIZE}))
|
|
LDFLAGS += --elf --scatter config/ram/CraneLS_DS_8M_Ram_8M_Flash_XIP_CIPSRAM_Common.sct \
|
|
--predefine="-DLTEONLY_THIN_SINGLE_SIM -DCRANEL_8MRAM"
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
endif
|
|
|
|
LIB_DIR_NAME:=lib_1609
|
|
endif
|
|
|
|
ifneq (,$(findstring 1607,${ASR_PLATFORM}))
|
|
LDFLAGS:=--via config/common/common_lib_list_1607.txt \
|
|
--via $(IMAGE_BUILD_DIR)/complied_lib.txt \
|
|
--predefine="-DL1_WIFI_LOCATION" \
|
|
--predefine="-DCRANE_MODULE_SUPPORT" \
|
|
--predefine="-DQUECTEL_OPEN_CPU" \
|
|
--map --symbols --info sizes,totals \
|
|
--keep init.o(Header) \
|
|
--keep init.o(Vectors) \
|
|
--diag_suppress 6312,6314,6319,6329 \
|
|
--feedback=config/common/feedbackLinkOptLteonlyThin.txt
|
|
|
|
include $(TOP_DIR)/config/common/default_dflags_1607.mk
|
|
COMMON_PP_LIST_FILE:=$(TOP_DIR)/config/common/common_pp_list_1607.txt
|
|
|
|
ifneq (,$(findstring 4M,${FLASH_SIZE}))
|
|
LDFLAGS += --elf --scatter config/ram/CraneLG_DS_4M_Ram_4M_Flash_XIP_CIPSRAM_Common.sct \
|
|
--predefine="-DLTEONLY_THIN_SINGLE_SIM -DCRANEL_4MRAM"
|
|
DFLAGS += -DLTEONLY_THIN_SINGLE_SIM
|
|
|
|
endif
|
|
|
|
LIB_DIR_NAME:=lib_1607
|
|
endif
|
|
|
|
ifeq (,$(findstring CC11XXW_GPS,${FLASHTYPE}))
|
|
DFLAGS += -UHX_GNSS_CC11_SUPPORT
|
|
endif
|
|
ifneq (,$(findstring ASR_GPS,${FLASHTYPE}))
|
|
DFLAGS += -UQUEC_HX_GNSS_SUPPORT -UHX_GNSS_CC11_SUPPORT
|
|
DFLAGS += -DQUEC_GPS_SUPPORT
|
|
endif
|
|
|
|
|
|
ifneq (,$(findstring QUEC_FGM842D_WIFI_SUPPORT,${DFLAGS}))
|
|
LDFLAGS += --predefine="-DQUEC_FGM842D_WIFI_SUPPORT"
|
|
endif
|
|
|
|
ifneq (,$(findstring QUECTEL_USBNET_SUPPORT,${DFLAGS}))
|
|
LDFLAGS += --predefine="-DQUECTEL_USBNET_SUPPORT"
|
|
endif
|
|
ifneq (,$(findstring QUEC_TRACK_IPC_SUPPORT,${DFLAGS}))
|
|
LDFLAGS += --predefine="-DQUEC_TRACK_IPC_SUPPORT"
|
|
endif
|
|
|
|
ifneq (,$(findstring LCD,${func}))
|
|
DFLAGS += -DQL_LCD
|
|
endif
|
|
|
|
ifneq (,$(findstring AMR,${func}))
|
|
DFLAGS += -DQL_AMR_FUNC -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
endif
|
|
|
|
ifneq (,$(findstring MP3,${func}))
|
|
DFLAGS += -DQL_MP3_FUNC -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
endif
|
|
|
|
ifneq (,$(findstring TTS,${func}))
|
|
DFLAGS += -DQL_AUDIO_TTS_SUPPORT -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
endif
|
|
|
|
ifneq (,$(findstring WAV,${func}))
|
|
DFLAGS += -DQL_WAV_FUNC -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
endif
|
|
|
|
ifneq (,$(findstring CAMERA,${func}))
|
|
DFLAGS += -DQL_CAMERA
|
|
endif
|
|
|
|
ifneq (,$(findstring NTP,${func}))
|
|
DFLAGS += -DQL_NTP
|
|
endif
|
|
|
|
ifneq (,$(findstring PING,${func}))
|
|
DFLAGS += -DQL_PING
|
|
endif
|
|
|
|
ifneq (,$(findstring MBEDTLS,${func}))
|
|
DFLAGS += -DQL_MBEDTLS
|
|
endif
|
|
|
|
ifneq (,$(findstring QL_AUDIO_DENOISE,${func}))
|
|
DFLAGS += -DQL_AUDIO_DENOISE -DQUEC_AUDIO -UNO_AUDIO
|
|
TARGET_COMMPILE_DIRS += audio/target_compile_dir
|
|
TARGET_CLEAN_DIRS += audio/target_clean_dir
|
|
|
|
endif
|
|
|
|
ifneq (,$(findstring DSSS_SPS,${func}))
|
|
DFLAGS += -DQL_PS_SINGLE_PHYSICAL_DUAL_SIM_SUPPORT
|
|
endif
|
|
|
|
ifneq (,$(findstring USBNET,${func}))
|
|
LDFLAGS += --predefine="-DQUECTEL_USBNET_SUPPORT"
|
|
endif
|
|
|
|
ifneq (,$(findstring KEYPAD,${func}))
|
|
DFLAGS += -DQL_KEYPAD
|
|
endif
|
|
|
|
SFLAGS:=-g ${MPU_FLAG} --no_unaligned_access --keep --apcs /inter --diag_suppress 1658
|
|
CFLAGS:=-c ${MPU_FLAG} --no_unaligned_access -g -O2 --apcs /inter --diag_suppress 2084,1,2,177,550,6319,188,1296 --diag_error 47 --gnu --thumb --loose_implicit_cast --feedback=$(TOP_DIR)/config/common/feedbackLinkOptLteonlyThin.txt
|
|
CPPFLAGS:=-c ${MPU_FLAG} --no_unaligned_access -g -O2 --apcs /inter --diag_suppress 2084,1,2,177,550,6319 --diag_error 47 --gnu --thumb --loose_implicit_cast --feedback=$(TOP_DIR)/config/common/feedbackLinkOptLteonlyThin.txt
|
|
ARFLAG:=-v --create -r
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Definition for compiling procedure
|
|
#-------------------------------------------------------------------------------
|
|
.PHONY: all clean CreateDir compile_lib_list
|
|
|
|
|
|
ifeq ($(strip $(PACKAGE_PATH)),$(subst $(strip \),/,$(strip $(TOP_DIR))))
|
|
#-------------------------------------------------------------------------------
|
|
# Top makefile
|
|
#-------------------------------------------------------------------------------
|
|
|
|
PREPARE:=CreateDir
|
|
IAMGE:=kernel
|
|
|
|
all:$(PREPARE) $(IAMGE)
|
|
|
|
CreateDir:
|
|
@if exist $(COMLIED_LIB_LIST_FILE) (@echo clean $(COMLIED_LIB_LIST_FILE) & del /s/q $(subst $(strip /),\,$(COMLIED_LIB_LIST_FILE)))
|
|
@if exist $(COMLIED_PP_LIST_FILE) (@echo clean $(COMLIED_PP_LIST_FILE) & del /s/q $(subst $(strip /),\,$(COMLIED_PP_LIST_FILE)))
|
|
@if not exist $(IMAGE_BUILD_DIR) ( \
|
|
md $(subst $(strip /),\,$(IMAGE_BUILD_DIR)) && \
|
|
xcopy /E/Y/I $(subst $(strip /),\,$(CREATE_BIN_TOOLS_DIR)) $(subst $(strip /),\,$(IMAGE_BUILD_DIR)\) \
|
|
) else ( \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IAMGE).bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE).bin))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IAMGE).axf (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE).axf))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IAMGE).map (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE).map))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/TIM_$(IAMGE).bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/TIM_$(IAMGE).bin))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/release_$(IAMGE).bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/release_$(IAMGE).bin))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IAMGE).init (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE).init))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IAMGE)_no_tim.bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE)_no_tim.bin))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IMAGE_NAME) (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IMAGE_NAME)))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/$(IMAGE_GENERAL_INFO)_compressed.bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IMAGE_GENERAL_INFO)_compressed.bin))) & \
|
|
(@if exist $(IMAGE_BUILD_DIR)/release_$(IAMGE)cp2.bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/release_$(IAMGE)cp2.bin))) \
|
|
)
|
|
|
|
clean: $(TARGET_CLEAN_DIRS)
|
|
@if exist $(IMAGE_BUILD_DIR) (@echo clean $(IMAGE_BUILD_DIR) & rd /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)))
|
|
|
|
%/target_clean_dir:%
|
|
gnumake -C $< -f Makefile clean TOP_DIR=$(TOP_DIR)
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Top makefile end
|
|
#-------------------------------------------------------------------------------
|
|
|
|
else
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Package makefile
|
|
#-------------------------------------------------------------------------------
|
|
|
|
PREPARE:=CreateDir
|
|
TARGET:=$(BUILD_DIR)/$(subst $(strip /),-,$(PACKAGE_NAME)).lib
|
|
|
|
all:$(PREPARE) compile_lib_list
|
|
|
|
CreateDir:
|
|
@if not exist $(BUILD_DIR) (md $(subst $(strip /),\,$(BUILD_DIR)))
|
|
@if not exist $(OBJ_DIR) (md $(subst $(strip /),\,$(OBJ_DIR)))
|
|
@if not exist $(ICAT_COMMAND_FILTER_PP_DIR) (md $(ICAT_COMMAND_FILTER_PP_DIR))
|
|
@for /d %%y in ($(subst $(strip /),\,$(SRC_DIRS))) do ( \
|
|
@if not exist $(OBJ_DIR)\%%y ( \
|
|
(@echo creating direcotry $(OBJ_DIR)\%%y) & (md $(subst $(strip /),\,$(OBJ_DIR)\%%y)) \
|
|
) \
|
|
)
|
|
|
|
clean:
|
|
@if exist $(BUILD_DIR) (@echo clean $(BUILD_DIR) & rd /s/q $(BUILD_DIR))
|
|
@if exist $(TARGET) (@echo clean $(TARGET) & rd /s/q $(TARGET))
|
|
|
|
#-------------------------------------------------------------------------------
|
|
# Package makefile end
|
|
#-------------------------------------------------------------------------------
|
|
endif
|
|
|
|
|
|
$(IAMGE):$(TARGET_COMMPILE_DIRS) $(TOP_DIR)/$(IMAGE_BUILD_DIR)/$(TXT_MDB_FILE_NAME)
|
|
@if exist $(IMAGE_BUILD_DIR)/$(IAMGE).map (del /s/q $(subst $(strip /),\,$(IAMGE).map))
|
|
$(LD) $(LDFLAGS) -o $(IMAGE_BUILD_DIR)/$(IAMGE).axf --list $(IMAGE_BUILD_DIR)/$(IAMGE).map
|
|
@if exist $(IMAGE_BUILD_DIR)/TIM_$(IAMGE).bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/TIM_$(IAMGE).bin))
|
|
@if exist $(IMAGE_BUILD_DIR)/release_$(IAMGE).bin (del /s/q $(subst $(strip /),\$(IMAGE_BUILD_DIR)/,release_$(IAMGE).bin))
|
|
@if exist $(IMAGE_BUILD_DIR)/$(IAMGE).init (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE).init))
|
|
@if exist $(IMAGE_BUILD_DIR)/$(IAMGE)_no_tim.bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IAMGE)_no_tim.bin))
|
|
@if exist $(IMAGE_BUILD_DIR)/$(IMAGE_NAME) (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IMAGE_NAME)))
|
|
@if exist $(IMAGE_BUILD_DIR)/$(IMAGE_GENERAL_INFO)_compressed.bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/$(IMAGE_GENERAL_INFO)_compressed.bin))
|
|
@if exist $(IMAGE_BUILD_DIR)/release_$(IAMGE)cp2.bin (del /s/q $(subst $(strip /),\,$(IMAGE_BUILD_DIR)/release_$(IAMGE)cp2.bin))
|
|
cd $(IMAGE_BUILD_DIR) & ( \
|
|
$(FROMELF) --bin --output $(IAMGE).bin $(IAMGE).axf && \
|
|
rspTIM.exe -image $(IAMGE).bin -param_db COMM && \
|
|
ren $(IAMGE).bin $(IAMGE)_no_tim.bin && \
|
|
ren TIM_$(IAMGE).bin $(IAMGE).bin && \
|
|
tavor_ddr_bin2init.exe $(IAMGE).bin $(IAMGE).init 32 && \
|
|
platform -p DKB_SS -t EVB_3 -i NONE -b $(IAMGE)_no_tim.bin -o $(IMAGE_NAME) && \
|
|
perl external_rw_region_lzma.pl $(IMAGE_NAME) ${IMAGE_GENERAL_INFO}_$(RAM_SIZE) && \
|
|
perl external_loadtable_update.pl $(IMAGE_NAME) $(IMAGE_GENERAL_INFO) && \
|
|
copy $(IMAGE_NAME) release_$(IAMGE).bin && \
|
|
(@if exist $(IMAGE_GENERAL_INFO)_compressed.bin (copy $(IMAGE_GENERAL_INFO)_compressed.bin release_$(IAMGE)cp2.bin )) \
|
|
)
|
|
|
|
$(TOP_DIR)/$(IMAGE_BUILD_DIR)/$(TXT_MDB_FILE_NAME):$(COMLIED_PP_LIST_FILE)
|
|
ifneq (,$(findstring -UNO_AUDIO,${DFLAGS}))
|
|
ifneq (,$(findstring 1606,${ASR_PLATFORM}))
|
|
@echo $(TOP_DIR)\common\lib_1606\aud_sw-Audio.lib >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(TOP_DIR)\common\lib_1606\aud_sw-Audio.pp >> $(COMLIED_PP_LIST_FILE)
|
|
endif
|
|
ifneq (,$(findstring 1602,${ASR_PLATFORM}))
|
|
@echo $(TOP_DIR)\common\lib_1602\aud_sw-Audio.lib >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(TOP_DIR)\common\lib_1602\aud_sw-Audio.pp >> $(COMLIED_PP_LIST_FILE)
|
|
endif
|
|
ifneq (,$(findstring 1603,${ASR_PLATFORM}))
|
|
@echo $(TOP_DIR)\common\lib_1603\aud_sw-Audio.lib >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(TOP_DIR)\common\lib_1603\aud_sw-Audio.pp >> $(COMLIED_PP_LIST_FILE)
|
|
endif
|
|
ifneq (,$(findstring 1605,${ASR_PLATFORM}))
|
|
@echo $(TOP_DIR)\common\lib_1602\aud_sw-Audio.lib >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(TOP_DIR)\common\lib_1602\aud_sw-Audio.pp >> $(COMLIED_PP_LIST_FILE)
|
|
endif
|
|
ifneq (,$(findstring 1609,${ASR_PLATFORM}))
|
|
@echo $(TOP_DIR)\common\lib_1609\aud_sw-Audio.lib >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(TOP_DIR)\common\lib_1609\aud_sw-Audio.pp >> $(COMLIED_PP_LIST_FILE)
|
|
endif
|
|
ifneq (,$(findstring 1607,${ASR_PLATFORM}))
|
|
@echo $(TOP_DIR)\common\lib_1607\aud_sw-Audio.lib >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(TOP_DIR)\common\lib_1607\aud_sw-Audio.pp >> $(COMLIED_PP_LIST_FILE)
|
|
endif
|
|
endif
|
|
cd $(TOP_DIR)/$(IMAGE_BUILD_DIR) &\
|
|
SETLOCAL ENABLEDELAYEDEXPANSION & \
|
|
(for /f "delims=" %%i in ('type $(subst $(strip /),\, $(COMMON_PP_LIST_FILE))') do (set common_pp_ret=!common_pp_ret!..\%%i )) & \
|
|
(for /f "delims=" %%i in ('type $(subst $(strip /),\, $(COMLIED_PP_LIST_FILE))') do (set compiled_pp_ret=!compiled_pp_ret!%%i )) & \
|
|
($(PERL) $(ICAT_COMMAND_FILTER) $(ICAT_COMMAND_FILTER_LIST) $(strip $(subst $(strip \ ),/,$(TOP_DIR)/$(IMAGE_BUILD_DIR)/cmd_filter_dir)) !common_pp_ret! !compiled_pp_ret!)& \
|
|
(if exist $(ICAT_COMMAND_FILTER_PP_LIST) (del /s/q $(ICAT_COMMAND_FILTER_PP_LIST))) &\
|
|
(for /f %%i in ('dir $(ICAT_COMMAND_FILTER_PP_DIR) /b /s') do (echo %%i>>$(ICAT_COMMAND_FILTER_PP_LIST)))& \
|
|
(for /f "delims=" %%i in ('type $(subst $(strip /),\, $(ICAT_COMMAND_FILTER_PP_LIST))') do (set icat_command_filter_pp=!icat_command_filter_pp!%%i )) & \
|
|
(if exist $(TXT_MDB_FILE_NAME) (del /s/q $(TXT_MDB_FILE_NAME))) &\
|
|
(del /s/q diagDB*) &\
|
|
($(PPL) $(TXT_MDB_FILE_NAME) $(DAIGDB_C_FILE_NAME) !icat_command_filter_pp! -f $(TOP_DIR)\config\mdb\3G_PS_Filter_file.txt -f $(TOP_DIR)\config\mdb\APLP_Filter_file.txt -f $(TOP_DIR)\config\mdb\diag_list.txt 1>nul) &\
|
|
ENDLOCAL &\
|
|
($(PPMAN) -S..\config\mdb\hsiupdlibdev.i -N$(TXT_MDB_FILE_NAME))&\
|
|
(if exist $(patsubst %.c,%.o,$(DAIGDB_C_FILE_NAME)) (del /s/q $(patsubst %.c,%.o,$(DAIGDB_C_FILE_NAME)))) &\
|
|
($(CC) $(CFLAGS) -DENV_XSCALE -DPLAT_USE_THREADX -I$(TOP_DIR)/common/include -o $(patsubst %.c,%.o,$(DAIGDB_C_FILE_NAME)) $(DAIGDB_C_FILE_NAME)) &\
|
|
(if exist $(patsubst %.c,%.o,$(DAIGDB_C_FILE_NAME)) (copy /y $(patsubst %.c,%.o,$(DAIGDB_C_FILE_NAME)) $(subst $(strip /),\,$(TOP_DIR)\common\$(LIB_DIR_NAME)\))) &\
|
|
cd ..
|
|
|
|
|
|
%/target_compile_dir:%
|
|
@echo ---------------compile [$<]-------------------
|
|
gnumake -C $< -f Makefile TOP_DIR=$(TOP_DIR)
|
|
|
|
compile_lib_list:$(TARGET)
|
|
@echo $(PACKAGE_PATH)/$(TARGET) >> $(COMLIED_LIB_LIST_FILE)
|
|
@echo $(patsubst %.lib,%.pp,$(subst $(strip /),\,$(PACKAGE_PATH)/$(TARGET))) >> $(COMLIED_PP_LIST_FILE)
|
|
ifneq ($(U_LIBS),)
|
|
@for /d %%y in ($(subst $(strip /),\,$(U_LIBS))) do ( \
|
|
(@echo %%y >> $(COMLIED_LIB_LIST_FILE)) \
|
|
)
|
|
endif
|
|
|
|
$(TARGET):$(OBJS)
|
|
@echo ---------------create lib [$@]-------------------
|
|
$(AR) $(ARFLAG) $@ $^
|
|
type $(patsubst %.o,%.pp,$(subst $(strip /),\,$^)) > $(patsubst %.lib,%.pp,$(subst $(strip /),\,$@))
|
|
|
|
|
|
$(OBJ_DIR)/%.o: %.S
|
|
$(ASM) $(SFLAGS) -o $@ $<
|
|
|
|
$(OBJ_DIR)/%.o: %.s
|
|
$(ASM) $(SFLAGS) -o $@ $<
|
|
|
|
$(OBJ_DIR)/%.o: %.c
|
|
$(CC) -E -C -D_PPC_ $(subst $(strip /),\,$<) $(CFLAGS) $(DFLAGS) $(U_FLAGS) $(INC_DIRS) -o $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) && $(PPC) $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) $(patsubst %.o,%.pp,$(subst $(strip /),\,$@))
|
|
$(CC) $(CFLAGS) $(DFLAGS) $(U_FLAGS) $(INC_DIRS) -o $@ $< --depend=$(patsubst %.c,$(subst $(strip \),/,$(OBJ_DIR))/%.d,$<)
|
|
|
|
$(OBJ_DIR)/%.o: %.cpp
|
|
$(CPP) -E -C -D_PPC_ $(subst $(strip /),\,$<) $(CPPFLAGS) $(DFLAGS) $(U_CPPFLAGS) $(INC_DIRS) -o $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) && $(PPC) $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) $(patsubst %.o,%.pp,$(subst $(strip /),\,$@))
|
|
$(CPP) $(CPPFLAGS) $(DFLAGS) $(U_CPPFLAGS) $(INC_DIRS) -o $@ $< --depend=$(patsubst %.cpp,$(subst $(strip \),/,$(OBJ_DIR))/%.d,$<)
|
|
|
|
$(OBJ_DIR)/%.o: %.cc
|
|
$(CPP) -E -C -D_PPC_ $(subst $(strip /),\,$<) $(CPPFLAGS) $(DFLAGS) $(U_CPPFLAGS) $(INC_DIRS) -o $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) && $(PPC) $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) $(patsubst %.o,%.pp,$(subst $(strip /),\,$@))
|
|
$(CPP) $(CPPFLAGS) $(DFLAGS) $(U_CPPFLAGS) $(INC_DIRS) -o $@ $< --depend=$(patsubst %.cc,$(subst $(strip \),/,$(OBJ_DIR))/%.d,$<)
|
|
|
|
$(OBJ_DIR)/%.o: %.cxx
|
|
$(CPP) -E -C -D_PPC_ $(subst $(strip /),\,$<) $(CPPFLAGS) $(DFLAGS) $(U_CPPFLAGS) $(INC_DIRS) -o $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) && $(PPC) $(patsubst %.o,%.ppp,$(subst $(strip /),\,$@)) $(patsubst %.o,%.pp,$(subst $(strip /),\,$@))
|
|
$(CPP) $(CPPFLAGS) $(DFLAGS) $(U_CPPFLAGS) $(INC_DIRS) -o $@ $< --depend=$(patsubst %.cxx,$(subst $(strip \),/,$(OBJ_DIR))/%.d,$<)
|
|
|
|
-include $(DEF_FILES)
|