aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitchBradley <wmb@firmworks.com>2018-10-21 17:05:52 +0000
committerMitchBradley <wmb@firmworks.com>2018-10-21 17:05:52 +0000
commitae7dbb60136393b905d064d3c1da23e6a82d5c77 (patch)
tree584f75e1cb9740d9554107259610b6745a159d8f
parentbadb404ee95cbf4f5437523d9be480837b583f51 (diff)
downloadcforth-ae7dbb60136393b905d064d3c1da23e6a82d5c77.tar.gz
esp8266 - auto-build Xtensa C compiler
-rw-r--r--build/esp8266/Makefile6
-rw-r--r--src/app/esp8266/targets.mk10
2 files changed, 13 insertions, 3 deletions
diff --git a/build/esp8266/Makefile b/build/esp8266/Makefile
index c7d23cd..a41250e 100644
--- a/build/esp8266/Makefile
+++ b/build/esp8266/Makefile
@@ -1,6 +1,7 @@
# Builds CForth for ESP8266
TOPDIR=../..
+UPDIR=$(realpath $(TOPDIR)/..)
# CONFIG += -DBITS32 -DT16
CONFIG += -DBITS32
@@ -11,9 +12,10 @@ CC := gcc
# Change these to reflect the locations of external stuff on your system,
# either here or on the command line, e.g. COMPORT=COM27 make download
-XTGCCPATH ?= $(realpath $(TOPDIR)/../esp-open-sdk/xtensa-lx106-elf/bin)/
+SDK_PARENT_PATH ?= $(UPDIR)
+XTGCCPATH ?= $(SDK_PARENT_PATH)/esp-open-sdk/xtensa-lx106-elf/bin/
CROSS ?= $(XTGCCPATH)xtensa-lx106-elf-
-NODEMCU_PARENT_PATH ?= $(realpath $(TOPDIR)/..)/
+NODEMCU_PARENT_PATH ?= $(UPDIR)/
NODEMCU_PATH ?= $(NODEMCU_PARENT_PATH)nodemcu-firmware
SDK_VER:=1.5.4.1
COMPORT ?= COM36
diff --git a/src/app/esp8266/targets.mk b/src/app/esp8266/targets.mk
index dec551c..379d541 100644
--- a/src/app/esp8266/targets.mk
+++ b/src/app/esp8266/targets.mk
@@ -113,7 +113,15 @@ $(NODEMCU_PATH)/sdk: $(NODEMCU_PATH)
$(PLAT_OBJS): $(NODEMCU_PATH)/sdk
-nodemcu-fw: app.o
+$(XTGCCPATH):
+ @echo Building Xtensa C cross compiler in 30 minutes or so
+ (cd $(SDK_PARENT_PATH) \
+ && git clone --recursive https://github.com/pfalcon/esp-open-sdk.git \
+ && cd $(SDK_PARENT_PATH)/esp-open-sdk \
+ && make STANDALONE=n \
+ )
+
+nodemcu-fw: $(XTGCCPATH) app.o
(cd $(NODEMCU_PATH) && PATH=${PATH}:$(XTGCCPATH) make --no-print-directory)
LOADCMD=tools/esptool.py --port $(COMPORT) -b 115200 write_flash -fm=dio -fs=32m 0x00000 bin/0x00000.bin 0x10000 bin/0x10000.bin