carl9170 toolchain: toolchain updates
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 31 May 2013 15:24:11 +0000 (17:24 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Fri, 31 May 2013 15:24:11 +0000 (17:24 +0200)
 + update to gcc-4.8.1

 + delete source files which failed the sha256 check

 + automatic parallel build of the toolchain

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
toolchain/Makefile
toolchain/SHA256SUMS

index ed3dcae53d37632a6e3c89acfe281d1abe5de8f4..3e29f8d536201251a46a8f33e17be23d862a4a0d 100644 (file)
@@ -6,61 +6,63 @@ NEWLIB_VER=2.0.0
 NEWLIB_TAR=newlib-$(NEWLIB_VER).tar.gz
 NEWLIB_URL="ftp://sourceware.org/pub/newlib/$(NEWLIB_TAR)"
 
-GCC_VER=4.8.0
+GCC_VER=4.8.1
 GCC_TAR=gcc-$(GCC_VER).tar.bz2
 GCC_URL="http://mirrors.kernel.org/gnu/gcc/gcc-$(GCC_VER)/$(GCC_TAR)"
 
+JOBS?=$(shell grep -c ^processor /proc/cpuinfo)
+
 BASEDIR=$(shell pwd)
 
 define checksum
 @if grep -q '  $(subst .,\.,$(1))$$' SHA256SUMS; then                  \
-       grep '  $(subst .,\.,$(1))$$' SHA256SUMS | sha256sum -c;        \
+       grep '  $(subst .,\.,$(1))$$' SHA256SUMS | sha256sum -c || rm $(1);     \
 else                                                                   \
        echo "WARNING: no checksum defined for $(1)";                   \
 fi
 endef
 
-all: gcc
+all: clean gcc
 
 src/$(BINUTILS_TAR):
-       wget -P src $(BINUTILS_URL)
+       wget -P "$(BASEDIR)/src" $(BINUTILS_URL)
        $(call checksum,$@)
 
 src/$(NEWLIB_TAR):
-       wget -P src $(NEWLIB_URL)
+       wget -P "$(BASEDIR)/src" $(NEWLIB_URL)
        $(call checksum,$@)
 
 src/$(GCC_TAR):
-       wget -P src $(GCC_URL)
+       wget -P "$(BASEDIR)/src" $(GCC_URL)
        $(call checksum,$@)
 
 src/binutils-$(BINUTILS_VER): src/$(BINUTILS_TAR)
-       tar -C src -xf $<
+       tar -C "$(BASEDIR)/src" -xf $<
 
 src/newlib-$(NEWLIB_VER): src/$(NEWLIB_TAR)
-       tar -C src -xf $<
+       tar -C "$(BASEDIR)/src" -xf $<
 
 src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER)
-       tar -C src -xf $<
+       tar -C "$(BASEDIR)/src" -xf $<
        ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/newlib $@
        ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@
 
 binutils: src/binutils-$(BINUTILS_VER)
-       mkdir -p build/binutils
-       cd build/binutils; \
+       mkdir -p "$(BASEDIR)/build/binutils"
+       cd "$(BASEDIR)/build/binutils"; \
        $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \
-       $(MAKE) -j3; \
+       $(MAKE) -j$(JOBS); \
        $(MAKE) install
 
 gcc: src/gcc-$(GCC_VER) binutils
-       mkdir -p build/gcc
-       cd build/gcc; \
+       mkdir -p "$(BASEDIR)/build/gcc"
+       cd "$(BASEDIR)/build/gcc"; \
        $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \
-       $(MAKE) -j3; \
+       $(MAKE) -j$(JOBS); \
        $(MAKE) install
 
 clean:
-       rm -rf build inst
-
+       rm -rf "$(BASEDIR)/build" "$(BASEDIR)/inst"
+       
 distclean: clean
-       rm -rf src
+       rm -rf "$(BASEDIR)/src"
index c8439d9fb21af2d5496b28ba73efbaa0300e6ee1..94bfe55416e36c7b0f2d9db0c2c89e4417f72d2b 100644 (file)
@@ -5,4 +5,5 @@ c644b2847244278c57bec2ddda69d8fab5a7c767f3b9af69aa7aa3da823ff692  src/newlib-1.2
 8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084  src/gcc-4.7.2.tar.bz2
 49c29e9129325e7c3b221aa829743ddcd796d024440e47c80fc0d6769af72d8a  src/newlib-2.0.0.tar.gz
 b037fe5132b71ecad2ea7141ec92292b5d32427bf90fd90cde432b1d5abacc2c  src/gcc-4.8.0.tar.bz2
+545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813  src/gcc-4.8.1.tar.bz2