From 9d8e11020261749ea0e9c62cd2178facf914585f Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 16 Dec 2016 11:30:37 +1100 Subject: [PATCH 1/2] Build system: Deal with the case where IDF_PATH contains ~ 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 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/make/project.mk b/make/project.mk index 0548002277..948bfda1f7 100644 --- a/make/project.mk +++ b/make/project.mk @@ -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) From de8ecdd3c1c1ddbfc374d49fd645fd0543669201 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 22 Dec 2016 10:31:20 +1100 Subject: [PATCH 2/2] build system: Fix Windows case when IDF_PATH contains colons (ie C:/) Closes github #166 https://github.com/espressif/esp-idf/issues/166 --- make/project.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/make/project.mk b/make/project.mk index 948bfda1f7..1625bdca90 100644 --- a/make/project.mk +++ b/make/project.mk @@ -44,15 +44,16 @@ $(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)) +# 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))) ifndef IDF_PATH $(error IDF_PATH variable is not set to a valid directory.) endif -ifneq ("$(IDF_PATH)","$(wildcard $(IDF_PATH))") +ifneq ("$(IDF_PATH)","$(realpath $(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 @@ -60,6 +61,10 @@ ifneq ("$(IDF_PATH)","$(wildcard $(IDF_PATH))") $(error If IDF_PATH is overriden on command line, it must be an absolute path with no embedded shell special characters) endif +ifneq ("$(IDF_PATH)","$(subst :,,$(IDF_PATH))") +$(error IDF_PATH cannot contain colons. If overriding IDF_PATH on Windows, use Cygwin-style /c/dir instead of C:/dir) +endif + # disable built-in make rules, makes debugging saner MAKEFLAGS_OLD := $(MAKEFLAGS) MAKEFLAGS +=-rR