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 <andrew@ncrmnt.org>
This commit is contained in:
parent
02a714d459
commit
a62293b698
13
Makefile
13
Makefile
@ -1,5 +1,5 @@
|
|||||||
TOP=$(PWD)
|
TOP=$(PWD)
|
||||||
TOOLCHAIN=$(TOP)/toolchain
|
TOOLCHAIN=$(TOP)/xtensa-lx106-elf
|
||||||
|
|
||||||
all: sdk_patch $(TOOLCHAIN)/lib/libhal.a $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
all: sdk_patch $(TOOLCHAIN)/lib/libhal.a $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
||||||
@echo
|
@echo
|
||||||
@ -7,9 +7,7 @@ all: sdk_patch $(TOOLCHAIN)/lib/libhal.a $(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc
|
|||||||
@echo
|
@echo
|
||||||
@echo 'export PATH=$(TOOLCHAIN)/bin:$$PATH'
|
@echo 'export PATH=$(TOOLCHAIN)/bin:$$PATH'
|
||||||
@echo
|
@echo
|
||||||
@echo "Espressif ESP8266 SDK is installed, to use it run compiler as follows:"
|
@echo "Espressif ESP8266 SDK is installed, additional blobs are installed into the toolchain"
|
||||||
@echo
|
|
||||||
@echo "xtensa-lx106-elf-gcc -I$(TOP)/sdk/include -L$(TOP)/sdk/lib"
|
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
sdk_patch: sdk/lib/libpp.a
|
sdk_patch: sdk/lib/libpp.a
|
||||||
@ -42,11 +40,16 @@ libhal:
|
|||||||
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc: crosstool-NG/ct-ng
|
$(TOOLCHAIN)/bin/xtensa-lx106-elf-gcc: crosstool-NG/ct-ng
|
||||||
make -C crosstool-NG -f ../Makefile toolchain
|
make -C crosstool-NG -f ../Makefile toolchain
|
||||||
|
|
||||||
toolchain:
|
toolchain: esp_iot_sdk_v0.9.2/.dir
|
||||||
./ct-ng xtensa-lx106-elf
|
./ct-ng xtensa-lx106-elf
|
||||||
sed -r -i.org s%CT_PREFIX_DIR=.*%CT_PREFIX_DIR="$(TOOLCHAIN)"% .config
|
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
|
sed -r -i s%CT_INSTALL_DIR_RO=y%"#"CT_INSTALL_DIR_RO=y% .config
|
||||||
|
echo CT_STATIC_TOOLCHAIN=y >> .config
|
||||||
./ct-ng build
|
./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
|
crosstool-NG/ct-ng: crosstool-NG/bootstrap
|
||||||
make -C crosstool-NG -f ../Makefile ct-ng
|
make -C crosstool-NG -f ../Makefile ct-ng
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user