]> granicus.if.org Git - esp-idf/commitdiff
build: In GNU Make, use "cygpath -m" to avoid backslashes
authorAngus Gratton <angus@espressif.com>
Tue, 17 Sep 2019 03:47:05 +0000 (13:47 +1000)
committerAngus Gratton <gus@projectgus.com>
Thu, 19 Sep 2019 11:36:16 +0000 (21:36 +1000)
Fixes issues where backslashes in KCONFIG paths are later expanded as shell escape sequences.

make/ldgen.mk
make/project_config.mk

index ebc7449c86a3fc1cb312231a20c0b1ab00c9b903..ddc318c798d52666cd36055600b6e7843b8e087f 100644 (file)
@@ -8,7 +8,7 @@ LDGEN_FRAGMENT_FILES = $(COMPONENT_LDFRAGMENTS)
 ifeq ($(OS),Windows_NT)
 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
+       printf "$(foreach info,$(LDGEN_SECTIONS_INFO_FILES),$(subst \,/,$(shell cygpath -m $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen.section_infos
 
 $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_infos
        @echo 'Generating $(notdir $(2))'
@@ -19,8 +19,8 @@ $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen.section_
                --output        $(2) \
                --sections      $(BUILD_DIR_BASE)/ldgen.section_infos \
                --kconfig       $(IDF_PATH)/Kconfig \
-               --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           "COMPONENT_KCONFIGS=$(foreach k, $(COMPONENT_KCONFIGS), $(shell cygpath -m $(k)))" \
+               --env           "COMPONENT_KCONFIGS_PROJBUILD=$(foreach k, $(COMPONENT_KCONFIGS_PROJBUILD), $(shell cygpath -m $(k)))" \
                --env           "IDF_CMAKE=n"
 endef
 else # Windows_NT
index 0046c44fbfd372f857e48fff698f20ac21f15c05..cea29ca0e98befd3075ecc72b15dcd126f1c483b 100644 (file)
@@ -6,8 +6,8 @@ COMPONENT_KCONFIGS_PROJBUILD := $(foreach component,$(COMPONENT_PATHS),$(wildcar
 
 ifeq ($(OS),Windows_NT)
 # kconfiglib requires Windows-style paths for kconfig files
-COMPONENT_KCONFIGS := $(shell cygpath -w $(COMPONENT_KCONFIGS))
-COMPONENT_KCONFIGS_PROJBUILD := $(shell cygpath -w $(COMPONENT_KCONFIGS_PROJBUILD))
+COMPONENT_KCONFIGS := $(shell cygpath -m $(COMPONENT_KCONFIGS))
+COMPONENT_KCONFIGS_PROJBUILD := $(shell cygpath -m $(COMPONENT_KCONFIGS_PROJBUILD))
 endif
 
 #For doing make menuconfig etc