diff --git a/.gitignore b/.gitignore index 619364340..0bf911dc6 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,4 @@ bin .idea *.iml -.idf_patched .idf_tools_installed diff --git a/Makefile b/Makefile index a3474997f..17892cb64 100644 --- a/Makefile +++ b/Makefile @@ -6,22 +6,22 @@ THIS_MK_FILE:=$(notdir $(lastword $(MAKEFILE_LIST))) THIS_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST)))) IDF_PATH=$(THIS_DIR)/sdk/esp32-esp-idf -all: .idf_tools_installed +all: | .idf_tools_installed . $(IDF_PATH)/export.sh && $(MAKE) "$@" -%: .idf_tools_installed +%: | .idf_tools_installed . $(IDF_PATH)/export.sh && $(MAKE) "$@" IDF_PATCHES:=$(wildcard idf-patches/*) -.idf_patched: $(IDF_PATCHES) +$(IDF_PATH)/.patched: $(IDF_PATCHES) @echo "Discarding local IDF changes..." (cd "$(IDF_PATH)" && git checkout . ) @echo "Patching IDF..." for f in $(IDF_PATCHES); do (cd "$(IDF_PATH)" && patch -p1 < "$(THIS_DIR)/$$f" ); done touch "$@" -.idf_tools_installed: .idf_patched +.idf_tools_installed: $(IDF_PATH)/.patched "$(THIS_DIR)/install.sh" touch "$@"