Unverified Commit 13735b72 authored by Arnim Läuger's avatar Arnim Läuger Committed by GitHub
Browse files

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
parent 386cd9d9
......@@ -7,6 +7,7 @@ sdkconfig.old*
build/
app/
components/*/.output/
tools/toolchains
#ignore Eclipse project files
.cproject
......
[submodule "toolchains"]
path = tools/toolchains
url = https://github.com/jmattsson/nodemcu-prebuilt-toolchains.git
[submodule "sdk/esp32-esp-idf"]
path = sdk/esp32-esp-idf
url = https://github.com/espressif/esp-idf.git
......
......@@ -5,10 +5,31 @@ ifeq ($(IDF_PATH),)
THIS_MK_FILE:=$(notdir $(lastword $(MAKEFILE_LIST)))
THIS_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
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...
@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
......
Subproject commit 3f4f3890f97fe01870770dd5a624ee0823d71a13
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment