]> granicus.if.org Git - esp-idf/commitdiff
build system: Account for Windows behaviour of make wildcard for some dirs
authorAngus Gratton <angus@espressif.com>
Wed, 4 Jan 2017 01:36:59 +0000 (12:36 +1100)
committerAngus Gratton <angus@espressif.com>
Wed, 22 Feb 2017 00:59:37 +0000 (11:59 +1100)
See github #166

make/project.mk
tools/windows/eclipse_make.sh

index 02ef7bb174e2fad912a8f7539011ef0b9b7b95dc..04015a8a8c9f68761ee20716e7ce8ddba4ce57da 100644 (file)
@@ -49,14 +49,23 @@ endif
 # make IDF_PATH a "real" absolute path
 # * works around the case where a shell character is embedded in the environment variable value.
 # * changes Windows-style C:/blah/ paths to MSYS/Cygwin style /c/blah
-export IDF_PATH:=$(realpath $(wildcard $(IDF_PATH)))
+ifeq ("$(OS)","Windows_NT")
+# On Windows MSYS2, make wildcard function returns empty string for paths of form /xyz
+# where /xyz is a directory inside the MSYS root - so we don't use it.
+SANITISED_IDF_PATH:=$(realpath $(IDF_PATH))
+else
+SANITISED_IDF_PATH:=$(realpath $(wildcard $(IDF_PATH)))
+endif
+
+export IDF_PATH := $(SANITISED_IDF_PATH)
 
 ifndef IDF_PATH
 $(error IDF_PATH variable is not set to a valid directory.)
 endif
 
-ifneq ("$(IDF_PATH)","$(realpath $(wildcard $(IDF_PATH)))")
-# due to the way make manages variables, this is hard to account for
+ifneq ("$(IDF_PATH)","$(SANITISED_IDF_PATH)")
+# implies IDF_PATH was overriden on make command line.
+# 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"
index 200d798ffa2700dc63b8d55e74f3d1322c3fde88..848705fba446620e397ef07ba71b527796286ef9 100755 (executable)
@@ -4,6 +4,7 @@
 # Eclipse's output parser expects to see output of the form C:/dir/dir/file but our Make
 # process uses MinGW paths of the form /c/dir/dir/file. So parse these out...
 #
-# (regexp deliberate only matches after a space character to try and avoid false-positives.)
+# A little hacky as it looks for any single character of form /X/something.
+#
 echo "Running make in $(pwd)"
-make $@ V=1 | sed -E "s@ /([a-z])/(.+)/@ \1:/\2/@g" | sed -E "s@-I/([a-z])/(.+)/@-I\1:/\2/@g" | sed -E "s@-L/([a-z])/(.+)/@-L\1:/\2/@g"
+make $@ V=1 | sed -E "s@/([a-z])/([^/+])@\1:/\2@g"