ifdef CUSTOM_CONFIG
rom: chk_custom_cfg create_custom_binaries
else
rom: create_binaries
endif
chk_custom_cfg:
ifdef CUSTOM_CONFIG
export CUSTOM_CONFIG
$(eval CUST_CFG_DATA_FILES=$(CUSTOM_CONFIG))
export CUST_CFG_DATA_FILES
$(eval CUST_CFG_DATA_MEM_FILES=$(addprefix bin/,$(notdir $(CUST_CFG_DATA_FILES:.csv=.mem))))
export CUST_CFG_DATA_MEM_FILES
$(eval CUST_CFG_DATA_BIN_FILES=$(addprefix bin/,$(notdir $(CUST_CFG_DATA_MEM_FILES:.mem=.bin))))
export CUST_CFG_DATA_BIN_FILES
$(eval CUST_COMBINED_BIN_FILES=$(subst .bin,_combined.bin,$(CUST_CFG_DATA_BIN_FILES)))
export CUST_COMBINED_BIN_FILES
@echo existing cfg files $(CUST_CFG_DATA_FILES)
@echo existing mem files $(CUST_CFG_DATA_MEM_FILES)
@echo existing bin files $(CUST_CFG_DATA_BIN_FILES)
@echo existing combined files $(CUST_COMBINED_BIN_FILES)
endif
build_images: copy_ops_imgs
create_binaries: config $(COMBINED_BIN_FILES)
create_custom_binaries: cust_config $(CUST_COMBINED_BIN_FILES)
@echo print all the pre required $^
@echo custom config bin files $(CUST_CFG_DATA_BIN_FILES)
@echo custom config bin files $(CUST_COMBINED_BIN_FILES)
在目标create_custom_binaries
中,仅打印$^
时,cust_config
也是目标$(CUST_COMBINED_BIN_FILES)
前提条件的一部分
cust_config
我对此表示感谢。我的目标是根据保存在CUSTOM_CONFIG中的输入来构建不同的目标