2 BINUTILS_TAR=binutils-$(BINUTILS_VER).tar.bz2
3 BINUTILS_URL="http://mirrors.kernel.org/gnu/binutils/$(BINUTILS_TAR)"
6 NEWLIB_TAR=newlib-$(NEWLIB_VER).tar.gz
7 NEWLIB_URL="ftp://sourceware.org/pub/newlib/$(NEWLIB_TAR)"
10 GCC_TAR=gcc-$(GCC_VER).tar.bz2
11 GCC_URL="http://mirrors.kernel.org/gnu/gcc/gcc-$(GCC_VER)/$(GCC_TAR)"
14 MPFR_TAR=mpfr-$(MPFR_VER).tar.gz
15 MPFR_URL="http://ftpmirror.gnu.org/gnu/mpfr/$(MPFR_TAR)"
18 GMP_TAR=gmp-$(GMP_VER).tar.gz
19 GMP_URL="http://ftpmirror.gnu.org/gnu/gmp/$(GMP_TAR)"
22 MPC_TAR=mpc-$(MPC_VER).tar.gz
23 MPC_URL="http://ftpmirror.gnu.org/gnu/mpc/$(MPC_TAR)"
25 JOBS?=$(shell grep -c ^processor /proc/cpuinfo)
30 @if grep -q ' $(subst .,\.,$(1))$$' SHA256SUMS; then \
31 grep ' $(subst .,\.,$(1))$$' SHA256SUMS | sha256sum -c || rm $(1); \
33 echo "WARNING: no checksum defined for $(1)"; \
40 wget -P "$(BASEDIR)/src" $(MPFR_URL)
44 wget -P "$(BASEDIR)/src" $(GMP_URL)
48 wget -P "$(BASEDIR)/src" $(MPC_URL)
52 wget -P "$(BASEDIR)/src" $(BINUTILS_URL)
56 wget -P "$(BASEDIR)/src" $(NEWLIB_URL)
60 wget -P "$(BASEDIR)/src" $(GCC_URL)
63 src/mpfr-$(MPFR_VER): src/$(MPFR_TAR)
64 tar -C "$(BASEDIR)/src" -xf $<
66 src/gmp-$(GMP_VER): src/$(GMP_TAR)
67 tar -C "$(BASEDIR)/src" -xf $<
69 src/mpc-$(MPC_VER): src/$(MPC_TAR)
70 tar -C "$(BASEDIR)/src" -xf $<
72 src/binutils-$(BINUTILS_VER): src/$(BINUTILS_TAR)
73 tar -C "$(BASEDIR)/src" -xf $<
75 src/newlib-$(NEWLIB_VER): src/$(NEWLIB_TAR)
76 tar -C "$(BASEDIR)/src" -xf $<
78 src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER)
79 tar -C "$(BASEDIR)/src" -xf $<
80 ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/newlib $@
81 ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@
83 binutils: src/binutils-$(BINUTILS_VER)
84 mkdir -p "$(BASEDIR)/build/binutils"
85 cd "$(BASEDIR)/build/binutils"; \
86 $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \
90 gcc: src/gcc-$(GCC_VER) src/mpc-$(MPC_VER) src/gmp-$(GMP_VER) src/mpfr-$(MPFR_VER) binutils
91 cd "$(BASEDIR)/src/gcc-$(GCC_VER)"; \
92 ln -s ../gmp-$(GMP_VER) gmp; \
93 ln -s ../mpfr-$(MPFR_VER) mpfr; \
94 ln -s ../mpc-$(MPC_VER) mpc
95 mkdir -p "$(BASEDIR)/build/gcc"
96 cd "$(BASEDIR)/build/gcc"; \
97 $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \
102 rm -rf "$(BASEDIR)/build" "$(BASEDIR)/inst"
105 rm -rf "$(BASEDIR)/src"