summaryrefslogtreecommitdiff
path: root/toolchain/export-toolchain
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf.samuelsson@atmel.com>2008-12-21 17:11:33 +0000
committerUlf Samuelsson <ulf.samuelsson@atmel.com>2008-12-21 17:11:33 +0000
commit85c7bde99ee2db7ea865032ef497f3b78ced9e75 (patch)
tree21082b3cd9b3e27782767b20430bf9d3457380b4 /toolchain/export-toolchain
parent9ad7d650041d4bb8ba640ea48d4fa7d6f44c2e57 (diff)
Allow creating a script for external use of Buildroot toolchain
Diffstat (limited to 'toolchain/export-toolchain')
-rw-r--r--toolchain/export-toolchain/Config.in8
-rw-r--r--toolchain/export-toolchain/Makefile.in28
2 files changed, 36 insertions, 0 deletions
diff --git a/toolchain/export-toolchain/Config.in b/toolchain/export-toolchain/Config.in
new file mode 100644
index 000000000..1de8dcb5b
--- /dev/null
+++ b/toolchain/export-toolchain/Config.in
@@ -0,0 +1,8 @@
+config BR2_EXPORT_TOOLCHAIN
+ bool "Create script exporting toolchain to home directory"
+ default n
+ help
+ This will generate a batchfile which, if run
+ will add the Buildroot toolchain to the user PATH
+ The file is called "$(ARCH)-uclibc-gcc-$(GCC_VERSION).sh"
+
diff --git a/toolchain/export-toolchain/Makefile.in b/toolchain/export-toolchain/Makefile.in
new file mode 100644
index 000000000..94ea13491
--- /dev/null
+++ b/toolchain/export-toolchain/Makefile.in
@@ -0,0 +1,28 @@
+# This generates a script which exports the toolchain
+# using a shell script
+
+GCC_SCRIPT:=$(ARCH)-uclibc-gcc-$(GCC_VERSION).sh
+GCC_SCRIPT_TEMP:=$(BINARIES_DIR)/$(GCC_SCRIPT)
+
+~/$(GCC_SCRIPT): cross_compiler
+ @echo "#!/bin/sh" > $(GCC_SCRIPT_TEMP)
+ @echo "# $(ARCH) cross compiler toolchain created $(DATE)" >> $(GCC_SCRIPT_TEMP)
+ @echo "# gcc-$(GCC_VERSION)" >> $(GCC_SCRIPT_TEMP)
+ @echo "# binutils-$(BINUTILS_VERSION)" >> $(GCC_SCRIPT_TEMP)
+ @echo "# uClibc-$(UCLIBC_VERSION)" >> $(GCC_SCRIPT_TEMP)
+ @echo "export GCCROOT=$(STAGING_DIR)/usr" >> $(GCC_SCRIPT_TEMP)
+ @echo "export PATH=\$$PATH:\$$GCCROOT/bin" >> $(GCC_SCRIPT_TEMP)
+ @echo "export CROSS_COMPILE=$(REAL_GNU_TARGET_NAME)-" >> $(GCC_SCRIPT_TEMP)
+ @cp $(GCC_SCRIPT_TEMP) ~/$(GCC_SCRIPT)
+ @cat ~/$(GCC_SCRIPT)
+
+export-toolchain: ~/$(GCC_SCRIPT)
+
+export-toolchain-clean:
+ rm -f ~/$(GCC_SCRIPT)
+ rm -f $(GCC_SCRIPT_TEMP)
+
+ifeq ($(BR2_EXPORT_TOOLCHAIN),y)
+TARGETS+=export-toolchain
+endif
+