cmake,make: add dependencies on template included scripts

pull/3089/head
Renz Christian Bagaporo 2018-12-19 22:16:58 +08:00
rodzic 022a1da4e9
commit acd0be8239
4 zmienionych plików z 20 dodań i 4 usunięć

Wyświetl plik

@ -2,6 +2,8 @@
# and component makefiles (component_wrapper.mk)
#
PYTHON=$(call dequote,$(CONFIG_PYTHON))
# Include project config makefile, if it exists.
#
# (Note that we only rebuild this makefile automatically for some

Wyświetl plik

@ -18,7 +18,8 @@ define ldgen_process_template
$(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk
printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(subst \,/,$(shell cygpath -w $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos
$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos \
$(shell $(PYTHON) $(IDF_PATH)/tools/ldgen/lddeps.py $(abspath $(1)))
@echo 'Generating $(notdir $(2))'
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
--input $(1) \
@ -36,7 +37,8 @@ define ldgen_process_template
$(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk
printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(info)\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos
$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos \
$(shell $(PYTHON) $(IDF_PATH)/tools/ldgen/lddeps.py $(abspath $(1)))
@echo 'Generating $(notdir $(2))'
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
--input $(1) \

Wyświetl plik

@ -417,7 +417,6 @@ export COMPILER_VERSION_STR COMPILER_VERSION_NUM GCC_NOT_5_2_0
CPPFLAGS += -DGCC_NOT_5_2_0=$(GCC_NOT_5_2_0)
export CPPFLAGS
PYTHON=$(call dequote,$(CONFIG_PYTHON))
# the app is the main executable built by the project
APP_ELF:=$(BUILD_DIR_BASE)/$(PROJECT_NAME).elf

Wyświetl plik

@ -47,6 +47,18 @@ endfunction()
# Passes a linker script template to the linker script generation tool for
# processing
function(ldgen_process_template template output)
get_filename_component(template ${template} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR})
execute_process(COMMAND ${PYTHON} ${IDF_PATH}/tools/ldgen/lddeps.py ${template}
OUTPUT_VARIABLE template_includes
ERROR_VARIABLE template_includes_err
)
if(template_includes_err)
message(FATAL_ERROR "Unable to parse linker script template for INCLUDEs\n" ${template_includes_err})
endif()
spaces2list(template_includes)
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/ldgen.section_infos
CONTENT "$<JOIN:$<TARGET_PROPERTY:ldgen_section_infos,SECTIONS_INFO_FILES>,\n>")
@ -65,7 +77,8 @@ function(ldgen_process_template template output)
--env "IDF_CMAKE=y"
--env "IDF_PATH=${IDF_PATH}"
--env "IDF_TARGET=${IDF_TARGET}"
DEPENDS ${template} $<TARGET_PROPERTY:ldgen,FRAGMENT_FILES> ${SDKCONFIG} ldgen_section_infos
DEPENDS ${template} $<TARGET_PROPERTY:ldgen,FRAGMENT_FILES> ${SDKCONFIG}
ldgen_section_infos ${template_includes}
)
get_filename_component(output_name ${output} NAME)