ESP32 precompiled toolchain (#2730)

* remove toolchains submodule

* remove toolchains dir

* download precompiled toolchain from https://github.com/jmattsson/esp-toolchains/releases

* remove toolchain target
delete toolchain with clean target

* avoid bash syntax
This commit is contained in:
Arnim Läuger 2019-04-22 14:45:27 +02:00 committed by GitHub
parent 386cd9d9b1
commit 13735b7228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 7 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ sdkconfig.old*
build/ build/
app/ app/
components/*/.output/ components/*/.output/
tools/toolchains
#ignore Eclipse project files #ignore Eclipse project files
.cproject .cproject

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "toolchains"]
path = tools/toolchains
url = https://github.com/jmattsson/nodemcu-prebuilt-toolchains.git
[submodule "sdk/esp32-esp-idf"] [submodule "sdk/esp32-esp-idf"]
path = sdk/esp32-esp-idf path = sdk/esp32-esp-idf
url = https://github.com/espressif/esp-idf.git url = https://github.com/espressif/esp-idf.git

View File

@ -5,10 +5,31 @@ ifeq ($(IDF_PATH),)
THIS_MK_FILE:=$(notdir $(lastword $(MAKEFILE_LIST))) THIS_MK_FILE:=$(notdir $(lastword $(MAKEFILE_LIST)))
THIS_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST)))) THIS_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
IDF_PATH=$(THIS_DIR)/sdk/esp32-esp-idf IDF_PATH=$(THIS_DIR)/sdk/esp32-esp-idf
all:
%: TOOLCHAIN_VERSION:=20181106.0
PLATFORM:=linux-x86_64
ESP32_BIN:=$(THIS_DIR)/tools/toolchains/esp32-$(PLATFORM)-$(TOOLCHAIN_VERSION)/bin
ESP32_GCC:=$(ESP32_BIN)/xtensa-esp32-elf-gcc
ESP32_TOOLCHAIN_DL:=$(THIS_DIR)/cache/toolchain-esp32-$(PLATFORM)-$(TOOLCHAIN_VERSION).tar.xz
all: | $(ESP32_GCC)
%: | $(ESP32_GCC)
@echo Setting IDF_PATH and re-invoking... @echo Setting IDF_PATH and re-invoking...
@env IDF_PATH=$(IDF_PATH) PATH=$(PATH):$(THIS_DIR)/tools/toolchains/esp32/bin/ $(MAKE) -f $(THIS_MK_FILE) $@ @env IDF_PATH=$(IDF_PATH) PATH=$(PATH):$(ESP32_BIN) $(MAKE) -f $(THIS_MK_FILE) $@
@if test "$@" = "clean"; then rm -rf $(THIS_DIR)/tools/toolchains/esp32-*; fi
$(ESP32_GCC): $(ESP32_TOOLCHAIN_DL)
@echo Uncompressing toolchain
@mkdir -p $(THIS_DIR)/tools/toolchains/
@tar -xJf $< -C $(THIS_DIR)/tools/toolchains/
# the archive contains ro files
@chmod -R u+w $(THIS_DIR)/tools/toolchains/esp32-*
@touch $@
$(ESP32_TOOLCHAIN_DL):
@mkdir -p $(THIS_DIR)/cache
wget --tries=10 --timeout=15 --waitretry=30 --read-timeout=20 --retry-connrefused https://github.com/jmattsson/esp-toolchains/releases/download/$(PLATFORM)-$(TOOLCHAIN_VERSION)/toolchain-esp32-$(PLATFORM)-$(TOOLCHAIN_VERSION).tar.xz -O $@ || { rm -f "$@"; exit 1; }
else else

@ -1 +0,0 @@
Subproject commit 3f4f3890f97fe01870770dd5a624ee0823d71a13