From a62293b6981560cfa05fd5ce7f28b4ca24edeb5e Mon Sep 17 00:00:00 2001 From: Andrew Andrianov Date: Tue, 18 Nov 2014 15:15:00 +0300 Subject: [PATCH] Create portable toolchain This commit adds changes required for the toolchain to be portable: * Toolchain built is now static * All SDK headers are installed into the toolchain itself * All blobs from SDK are installed into toolchain itself * Toolchain directory name is its GNU_TARGET_NAME by default This also removes the need to specify the -L and -I flags while building the actual software to include SDK libraries Signed-off-by: Andrew Andrianov --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0188d1d..4c83446 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ TOP=$(PWD) -TOOLCHAIN=$(TOP)/toolchain +TOOLCHAIN=$(TOP)/xtensa-lx106-elf all: sdk_patch $(TOOLCHAIN)/lib/libhal.a $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc @echo @@ -7,9 +7,7 @@ all: sdk_patch $(TOOLCHAIN)/lib/libhal.a $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc @echo @echo 'export PATH=$(TOOLCHAIN)/bin:$$PATH' @echo - @echo "Espressif ESP8266 SDK is installed, to use it run compiler as follows:" - @echo - @echo "xtensa-lx106-elf-gcc -I$(TOP)/sdk/include -L$(TOP)/sdk/lib" + @echo "Espressif ESP8266 SDK is installed, additional blobs are installed into the toolchain" @echo sdk_patch: sdk/lib/libpp.a @@ -42,11 +40,16 @@ libhal: $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc: crosstool-NG/ct-ng make -C crosstool-NG -f ../Makefile toolchain -toolchain: +toolchain: esp_iot_sdk_v0.9.2/.dir ./ct-ng xtensa-lx106-elf sed -r -i.org s%CT_PREFIX_DIR=.*%CT_PREFIX_DIR="$(TOOLCHAIN)"% .config sed -r -i s%CT_INSTALL_DIR_RO=y%"#"CT_INSTALL_DIR_RO=y% .config + echo CT_STATIC_TOOLCHAIN=y >> .config ./ct-ng build + @echo "Installing additional SDK headers" + @cp -Rfv sdk/include/* $(TOOLCHAIN)/xtensa-lx106-elf/usr/include/ + @echo "Installing additional SDK blobs" + @cp -Rfv sdk/lib/* $(TOOLCHAIN)/xtensa-lx106-elf/lib/ crosstool-NG/ct-ng: crosstool-NG/bootstrap make -C crosstool-NG -f ../Makefile ct-ng