]> granicus.if.org Git - esp-idf/commitdiff
Build system: Deal with the case where IDF_PATH contains ~
authorAngus Gratton <angus@espressif.com>
Fri, 16 Dec 2016 00:30:37 +0000 (11:30 +1100)
committerAngus Gratton <angus@espressif.com>
Fri, 16 Dec 2016 00:30:37 +0000 (11:30 +1100)
See github issue https://github.com/espressif/esp-idf/issues/118

(This is easier to work around in the build system than to document.)

make/project.mk

index 0548002277c9364e5f34f57ea5e2f527a9cba4b5..948bfda1f78edfe36877070c61592361a41525db 100644 (file)
@@ -44,6 +44,22 @@ $(warning "esp-idf build system only supports GNU Make versions 3.81 or newer. Y
 endif
 endif
 
+# make IDF_PATH an absolute path
+# (works around the case where a shell character is embedded in the environment variable value.)
+export IDF_PATH:=$(wildcard $(IDF_PATH))
+
+ifndef IDF_PATH
+$(error IDF_PATH variable is not set to a valid directory.)
+endif
+
+ifneq ("$(IDF_PATH)","$(wildcard $(IDF_PATH))")
+# due to the way make manages variables, this is hard to account for
+#
+# if you see this error, do the shell expansion in the shell ie
+# make IDF_PATH=~/blah not make IDF_PATH="~/blah"
+$(error If IDF_PATH is overriden on command line, it must be an absolute path with no embedded shell special characters)
+endif
+
 # disable built-in make rules, makes debugging saner
 MAKEFLAGS_OLD := $(MAKEFLAGS)
 MAKEFLAGS +=-rR
@@ -345,7 +361,7 @@ $(foreach component,$(TEST_COMPONENT_PATHS),$(eval $(call GenerateComponentTarge
 app-clean: $(addsuffix -clean,$(notdir $(COMPONENT_PATHS_BUILDABLE)))
        $(summary) RM $(APP_ELF)
        rm -f $(APP_ELF) $(APP_BIN) $(APP_MAP)
-       
+
 size: $(APP_ELF)
        $(SIZE) $(APP_ELF)