Merge branch 'bugfix/windows_detection_on_make' into 'master'

Windows detection on Makefiles cleanup

See merge request idf/esp-idf!4945
This commit is contained in:
Angus Gratton 2019-05-20 13:59:05 +08:00
commit c8a2760741
2 changed files with 4 additions and 12 deletions

View file

@ -2,17 +2,9 @@
LDGEN_FRAGMENT_FILES = $(COMPONENT_LDFRAGMENTS) LDGEN_FRAGMENT_FILES = $(COMPONENT_LDFRAGMENTS)
LDGEN_LIBRARIES=$(foreach libcomp,$(COMPONENT_LIBRARIES),$(BUILD_DIR_BASE)/$(libcomp)/lib$(libcomp).a) LDGEN_LIBRARIES=$(foreach libcomp,$(COMPONENT_LIBRARIES),$(BUILD_DIR_BASE)/$(libcomp)/lib$(libcomp).a)
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 # Target to generate linker script generator from fragments presented by each of
# the components # the components
ifeq ($(ON_WINDOWS),y) ifeq ($(OS),Windows_NT)
define ldgen_process_template define ldgen_process_template
$(BUILD_DIR_BASE)/ldgen_libraries: $(LDGEN_LIBRARIES) $(IDF_PATH)/make/ldgen.mk $(BUILD_DIR_BASE)/ldgen_libraries: $(LDGEN_LIBRARIES) $(IDF_PATH)/make/ldgen.mk
printf "$(foreach info,$(LDGEN_LIBRARIES),$(subst \,/,$(shell cygpath -w $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen_libraries printf "$(foreach info,$(LDGEN_LIBRARIES),$(subst \,/,$(shell cygpath -w $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen_libraries
@ -31,7 +23,7 @@ $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen_librarie
--env "IDF_CMAKE=n" \ --env "IDF_CMAKE=n" \
--objdump $(OBJDUMP) --objdump $(OBJDUMP)
endef endef
else # ON_WINDOWS else # Windows_NT
define ldgen_process_template define ldgen_process_template
$(BUILD_DIR_BASE)/ldgen_libraries: $(LDGEN_LIBRARIES) $(IDF_PATH)/make/ldgen.mk $(BUILD_DIR_BASE)/ldgen_libraries: $(LDGEN_LIBRARIES) $(IDF_PATH)/make/ldgen.mk
printf "$(foreach library,$(LDGEN_LIBRARIES),$(library)\n)" > $(BUILD_DIR_BASE)/ldgen_libraries printf "$(foreach library,$(LDGEN_LIBRARIES),$(library)\n)" > $(BUILD_DIR_BASE)/ldgen_libraries
@ -50,7 +42,7 @@ $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen_librarie
--env "IDF_CMAKE=n" \ --env "IDF_CMAKE=n" \
--objdump $(OBJDUMP) --objdump $(OBJDUMP)
endef endef
endif # ON_WINDOWS endif # Windows_NT
define ldgen_create_commands define ldgen_create_commands
ldgen-clean: ldgen-clean:

View file

@ -4,7 +4,7 @@
COMPONENT_KCONFIGS := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig)) COMPONENT_KCONFIGS := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig))
COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig.projbuild)) COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcard $(component)/Kconfig.projbuild))
ifdef MSYSTEM ifeq ($(OS),Windows_NT)
# kconfiglib requires Windows-style paths for kconfig files # kconfiglib requires Windows-style paths for kconfig files
COMPONENT_KCONFIGS := $(shell cygpath -w $(COMPONENT_KCONFIGS)) COMPONENT_KCONFIGS := $(shell cygpath -w $(COMPONENT_KCONFIGS))
COMPONENT_KCONFIGS_PROJBUILD := $(shell cygpath -w $(COMPONENT_KCONFIGS_PROJBUILD)) COMPONENT_KCONFIGS_PROJBUILD := $(shell cygpath -w $(COMPONENT_KCONFIGS_PROJBUILD))