Merge branch 'bugfix/ldgen_make_build_regression' into 'master'

Fix 'command not found' error when building on linux with make

See merge request idf/esp-idf!3977
This commit is contained in:
Angus Gratton 2018-12-18 06:41:23 +08:00
commit 972cf1b416
2 changed files with 19 additions and 8 deletions

View file

@ -3,19 +3,23 @@
LDGEN_SECTIONS_INFO_FILES = $(foreach lib, $(COMPONENT_LIBRARIES), $(BUILD_DIR_BASE)/$(lib)/lib$(lib).a.sections_info)
LDGEN_FRAGMENT_FILES = $(COMPONENT_LDFRAGMENTS)
ON_WINDOWS:=n
ifdef OS
ifeq ($(OS),Windows_NT)
ON_WINDOWS:=y
endif
endif
# Target to generate linker script generator from fragments presented by each of
# the components
ifeq ($(ON_WINDOWS),y)
define ldgen_process_template
$(BUILD_DIR_BASE)/ldgen.section_infos: $(LDGEN_SECTIONS_INFO_FILES) $(IDF_PATH)/make/ldgen.mk
ifeq ($(OS), Windows_NT)
printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(subst \,/,$(shell cygpath -w $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
else
printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(info)\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
endif
$(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos
@echo 'Generating $(notdir $(2))'
ifeq ($(OS), Windows_NT)
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
--input $(1) \
--config $(SDKCONFIG) \
@ -26,7 +30,14 @@ ifeq ($(OS), Windows_NT)
--env "COMPONENT_KCONFIGS=$(foreach k, $(COMPONENT_KCONFIGS), $(shell cygpath -w $(k)))" \
--env "COMPONENT_KCONFIGS_PROJBUILD=$(foreach k, $(COMPONENT_KCONFIGS_PROJBUILD), $(shell cygpath -w $(k)))" \
--env "IDF_CMAKE=n"
else
endef
else # ON_WINDOWS
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
@echo 'Generating $(notdir $(2))'
$(PYTHON) $(IDF_PATH)/tools/ldgen/ldgen.py \
--input $(1) \
--config $(SDKCONFIG) \
@ -37,8 +48,8 @@ else
--env "COMPONENT_KCONFIGS=$(COMPONENT_KCONFIGS)" \
--env "COMPONENT_KCONFIGS_PROJBUILD=$(COMPONENT_KCONFIGS_PROJBUILD)" \
--env "IDF_CMAKE=n"
endif
endef
endif # ON_WINDOWS
define ldgen_create_commands
$(foreach lib, $(COMPONENT_LIBRARIES), \

View file

@ -152,7 +152,7 @@ build_example () {
cat ${BUILDLOG}
popd
grep -i "error\|warning" "${BUILDLOG}" 2>&1 >> "${LOG_SUSPECTED}" || :
grep -i "error\|warning\|command not found" "${BUILDLOG}" 2>&1 >> "${LOG_SUSPECTED}" || :
}
EXAMPLE_NUM=0