To avoid semi-open binary toolchains: This patch adds a toolchain subdir and Makefile to download, build and install our own gnu sh2 toolchain into that directory. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxx> --- toolchain/Makefile | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 toolchain/Makefile diff --git a/.gitignore b/.gitignore index 6dd924f..d2fa705 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ fw.map *~ *.dis +toolchain/src +toolchain/build +toolchain/inst diff --git a/toolchain/Makefile b/toolchain/Makefile new file mode 100644 index 0000000..d5468eb --- /dev/null +++ b/toolchain/Makefile @@ -0,0 +1,54 @@ +BINUTILS_VER=2.19.1 +BINUTILS_URL=http://mirrors.kernel.org/gnu/binutils/binutils-$(BINUTILS_VER).tar.bz2 +BINUTILS_TAR=binutils-$(BINUTILS_VER).tar.bz2 + +NEWLIB_VER=1.17.0 +NEWLIB_URL=ftp://sources.redhat.com/pub/newlib/newlib-$(NEWLIB_VER).tar.gz +NEWLIB_TAR=newlib-$(NEWLIB_VER).tar.gz + +GCC_VER=4.3.3 +GCC_URL=http://mirrors.kernel.org/gnu/gcc/gcc-$(GCC_VER)/gcc-core-$(GCC_VER).tar.bz2 +GCC_TAR=gcc-core-$(GCC_VER).tar.bz2 + +BASEDIR=$(shell pwd) + +all: gcc + +src/$(BINUTILS_TAR): + wget -P src $(BINUTILS_URL) + +src/$(NEWLIB_TAR): + wget -P src $(NEWLIB_URL) + +src/$(GCC_TAR): + wget -P src $(GCC_URL) + +src/binutils-$(BINUTILS_VER): src/$(BINUTILS_TAR) + tar -C src -xjf $< + +src/newlib-$(NEWLIB_VER): src/$(NEWLIB_TAR) + tar -C src -xzf $< + +src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER) + tar -C src -xjf $< + ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/{newlib,libgloss} $@ + +binutils: src/binutils-$(BINUTILS_VER) + mkdir -p build/binutils + cd build/binutils; \ + $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \ + $(MAKE); \ + $(MAKE) install + +gcc: src/gcc-$(GCC_VER) binutils + mkdir -p build/gcc + cd build/gcc; \ + $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \ + $(MAKE); \ + $(MAKE) install + +clean: + rm -rf build inst + +distclean: clean + rm -rf src
Attachment:
signature.asc
Description: OpenPGP digital signature