为什么目标的先决条件显示为空?

时间:2019-03-15 05:37:51

标签: makefile gnu-make

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
  • 为什么前提条件$(CUST_COMBINED_BIN_FILES)对于目标为空
  • create_custom_binaries?而@echo自定义配置bin文件 $(CUST_COMBINED_BIN_FILES)给出正确的值!

我对此表示感谢。我的目标是根据保存在CUSTOM_CONFIG中的输入来构建不同的目标

0 个答案:

没有答案