mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
cmake,make: add dependencies on template included scripts
This commit is contained in:
parent
022a1da4e9
commit
acd0be8239
@ -2,6 +2,8 @@
|
|||||||
# and component makefiles (component_wrapper.mk)
|
# and component makefiles (component_wrapper.mk)
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PYTHON=$(call dequote,$(CONFIG_PYTHON))
|
||||||
|
|
||||||
# Include project config makefile, if it exists.
|
# Include project config makefile, if it exists.
|
||||||
#
|
#
|
||||||
# (Note that we only rebuild this makefile automatically for some
|
# (Note that we only rebuild this makefile automatically for some
|
||||||
|
@ -18,7 +18,8 @@ define ldgen_process_template
|
|||||||
$(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk
|
$(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
|
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))'
|
@echo 'Generating $(notdir $(2))'
|
||||||
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
|
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
|
||||||
--input $(1) \
|
--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
|
$(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
|
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))'
|
@echo 'Generating $(notdir $(2))'
|
||||||
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
|
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
|
||||||
--input $(1) \
|
--input $(1) \
|
||||||
|
@ -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)
|
CPPFLAGS += -DGCC_NOT_5_2_0=$(GCC_NOT_5_2_0)
|
||||||
export CPPFLAGS
|
export CPPFLAGS
|
||||||
|
|
||||||
PYTHON=$(call dequote,$(CONFIG_PYTHON))
|
|
||||||
|
|
||||||
# the app is the main executable built by the project
|
# the app is the main executable built by the project
|
||||||
APP_ELF:=$(BUILD_DIR_BASE)/$(PROJECT_NAME).elf
|
APP_ELF:=$(BUILD_DIR_BASE)/$(PROJECT_NAME).elf
|
||||||
|
@ -47,6 +47,18 @@ endfunction()
|
|||||||
# Passes a linker script template to the linker script generation tool for
|
# Passes a linker script template to the linker script generation tool for
|
||||||
# processing
|
# processing
|
||||||
function(ldgen_process_template template output)
|
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
|
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/ldgen.section_infos
|
||||||
CONTENT "$<JOIN:$<TARGET_PROPERTY:ldgen_section_infos,SECTIONS_INFO_FILES>,\n>")
|
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_CMAKE=y"
|
||||||
--env "IDF_PATH=${IDF_PATH}"
|
--env "IDF_PATH=${IDF_PATH}"
|
||||||
--env "IDF_TARGET=${IDF_TARGET}"
|
--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)
|
get_filename_component(output_name ${output} NAME)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user