build: Check for .git, but it doesn't have to be a directory, so that esp-idf will work as a submodule

Merges #438 https://github.com/espressif/esp-idf/pull/438
This commit is contained in:
Edmund Huber 2017-03-19 23:11:13 -07:00 committed by Angus Gratton
parent 0aab67f0aa
commit 5272bd899b

View file

@ -409,7 +409,7 @@ define GenerateSubmoduleCheckTarget
check-submodules: $(IDF_PATH)/$(1)/.git
$(IDF_PATH)/$(1)/.git:
@echo "WARNING: Missing submodule $(1)..."
[ -d ${IDF_PATH}/.git ] || ( echo "ERROR: esp-idf must be cloned from git to work."; exit 1)
[ -e ${IDF_PATH}/.git ] || ( echo "ERROR: esp-idf must be cloned from git to work."; exit 1)
[ -x $(which git) ] || ( echo "ERROR: Need to run 'git submodule init $(1)' in esp-idf root directory."; exit 1)
@echo "Attempting 'git submodule update --init $(1)' in esp-idf root directory..."
cd ${IDF_PATH} && git submodule update --init $(1)