]> 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>
Tue, 17 Sep 2019 03:47:05 +0000 (13:47 +1000)
Fixes issues where backslashes in KCONFIG paths are later expanded as shell escape sequences.

make/ldgen.mk
make/project_config.mk

index 8519a0133843e3d9f90d023b5ac4d7d8aef85d42..01fd2ccb79d1a3885e4cf577187b6eb5e8d49963 100644 (file)
@@ -7,7 +7,7 @@ LDGEN_LIBRARIES=$(foreach libcomp,$(COMPONENT_LIBRARIES),$(BUILD_DIR_BASE)/$(lib
 ifeq ($(OS),Windows_NT)
 define ldgen_process_template
 $(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 -m $(info)))\n)" > $(BUILD_DIR_BASE)/ldgen_libraries
 
 $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen_libraries
        @echo 'Generating $(notdir $(2))'
@@ -18,8 +18,8 @@ $(2): $(1) $(LDGEN_FRAGMENT_FILES) $(SDKCONFIG) $(BUILD_DIR_BASE)/ldgen_librarie
                --libraries-file $(BUILD_DIR_BASE)/ldgen_libraries \
                --output        $(2) \
                --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" \
                --objdump               $(OBJDUMP)
 endef
@@ -47,4 +47,4 @@ endif # Windows_NT
 define ldgen_create_commands
 ldgen-clean:
        rm -f $(BUILD_DIR_BASE)/ldgen_libraries
-endef
\ No newline at end of file
+endef
index 1a4e74126651127878b0b8a9c0cb1137c8d00878..d5e8020dc6f8165ebc145308357accc9e6b52f6e 100644 (file)
@@ -7,9 +7,9 @@ COMPONENT_SDKCONFIG_RENAMES := $(foreach component,$(COMPONENT_PATHS),$(wildcard
 
 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_SDKCONFIG_RENAMES := $(shell cygpath -w $(COMPONENT_SDKCONFIG_RENAMES))
+COMPONENT_KCONFIGS := $(shell cygpath -m $(COMPONENT_KCONFIGS))
+COMPONENT_KCONFIGS_PROJBUILD := $(shell cygpath -m $(COMPONENT_KCONFIGS_PROJBUILD))
+COMPONENT_SDKCONFIG_RENAMES := $(shell cygpath -m $(COMPONENT_SDKCONFIG_RENAMES))
 endif
 
 #For doing make menuconfig etc