]> granicus.if.org Git - esp-idf/blobdiff - make/common.mk
Merge branch 'bugfix/btdm_fix_stop_adv_error_in_dual_core' into 'master'
[esp-idf] / make / common.mk
index 358c8808890faf8af2c5101c563acd09f673cc84..2eb0f0d3c0a8072effdd0ed1c10478144c8cfa73 100644 (file)
@@ -29,7 +29,11 @@ summary := @echo
 details := @true
 
 # disable echoing of commands, directory names
-MAKEFLAGS += --silent --warn-undefined-variables
+MAKEFLAGS += --silent
+endif  # $(V)==1
+
+ifdef CONFIG_MAKE_WARN_UNDEFINED_VARIABLES
+MAKEFLAGS += --warn-undefined-variables
 endif
 
 # General make utilities
@@ -58,7 +62,7 @@ endef
 #
 # example $(call resolvepath,$(CONFIG_PATH),$(CONFIG_DIR))
 define resolvepath
-$(foreach dir,$(1),$(if $(filter /%,$(dir)),$(dir),$(subst //,/,$(2)/$(dir))))
+$(abspath $(foreach dir,$(1),$(if $(filter /%,$(dir)),$(dir),$(subst //,/,$(2)/$(dir)))))
 endef
 
 
@@ -82,3 +86,11 @@ endef
 define uniq
 $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
 endef
+
+# macro to strip leading ../s from a path
+# Given $(1) which is a directory, remove any leading ../s from it
+# (recursively keeps removing ../ until not found)
+# if the path contains nothing but ../.., a single . is returned (cwd)
+define stripLeadingParentDirs
+$(foreach path,$(1),$(if $(subst ..,,$(path)),$(if $(filter ../%,$(path)),$(call stripLeadingParentDirs,$(patsubst ../%,%,$(path))),$(path)),.))
+endef