2 GMP_URL=http://ftp.gnu.org/gnu/gmp/gmp-$(GMP_VER).tar.bz2
3 GMP_TAR=gmp-$(GMP_VER).tar.bz2
6 MPFR_URL=http://ftp.gnu.org/gnu/mpfr/mpfr-$(MPFR_VER).tar.bz2
7 MPFR_TAR=mpfr-$(MPFR_VER).tar.bz2
10 MPC_URL=http://ftp.gnu.org/gnu/mpc/mpc-$(MPC_VER).tar.gz
11 MPC_TAR=mpc-$(MPC_VER).tar.gz
14 BINUTILS_URL=http://ftp.gnu.org/gnu/binutils/binutils-$(BINUTILS_VER).tar.bz2
15 BINUTILS_TAR=binutils-$(BINUTILS_VER).tar.bz2
18 GCC_URL=http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VER)/gcc-$(GCC_VER).tar.bz2
19 GCC_TAR=gcc-$(GCC_VER).tar.bz2
22 TOOLCHAIN_DIR=$(BASEDIR)/toolchain
28 wget -N -P $(TOOLCHAIN_DIR)/dl $(GMP_URL)
29 tar -C $(TOOLCHAIN_DIR)/dl -xjf $(TOOLCHAIN_DIR)/dl/$(GMP_TAR)
32 mkdir -p $(TOOLCHAIN_DIR)/build/gmp
33 cd $(TOOLCHAIN_DIR)/build/gmp; \
34 $(TOOLCHAIN_DIR)/dl/$</configure --disable-shared --enable-static --prefix=$(TOOLCHAIN_DIR)/inst; \
35 $(MAKE); $(MAKE) check;$(MAKE) install
38 wget -N -P $(TOOLCHAIN_DIR)/dl $(MPFR_URL)
39 tar -C $(TOOLCHAIN_DIR)/dl -xjf $(TOOLCHAIN_DIR)/dl/$(MPFR_TAR)
41 mpfr: mpfr-$(MPFR_VER)
42 mkdir -p $(TOOLCHAIN_DIR)/build/mpfr
43 cd $(TOOLCHAIN_DIR)/build/mpfr; \
44 $(TOOLCHAIN_DIR)/dl/$</configure --disable-shared --enable-static --with-gmp=$(TOOLCHAIN_DIR)/inst \
45 --prefix=$(TOOLCHAIN_DIR)/inst; \
46 $(MAKE); $(MAKE) check;$(MAKE) install
49 wget -N -P $(TOOLCHAIN_DIR)/dl $(MPC_URL)
50 tar -C $(TOOLCHAIN_DIR)/dl -zxvf $(TOOLCHAIN_DIR)/dl/$(MPC_TAR)
53 mkdir -p $(TOOLCHAIN_DIR)/build/mpfc
54 cd $(TOOLCHAIN_DIR)/build/mpfc; \
55 $(TOOLCHAIN_DIR)/dl/$</configure --disable-shared --enable-static --with-gmp=$(TOOLCHAIN_DIR)/inst \
56 --with-mpfr=$(TOOLCHAIN_DIR)/inst --prefix=$(TOOLCHAIN_DIR)/inst; \
57 $(MAKE); $(MAKE) check;$(MAKE) install
59 binutils-$(BINUTILS_VER):
60 wget -N -P $(TOOLCHAIN_DIR)/dl $(BINUTILS_URL)
61 tar -C $(TOOLCHAIN_DIR)/dl -xjf $(TOOLCHAIN_DIR)/dl/$(BINUTILS_TAR)
62 patch -d $(TOOLCHAIN_DIR)/dl/$@ -p1 < local/patches/binutils.patch
64 binutils: binutils-$(BINUTILS_VER)
65 mkdir -p $(TOOLCHAIN_DIR)/build/binutils
66 cd $(TOOLCHAIN_DIR)/build/binutils; \
67 $(TOOLCHAIN_DIR)/dl/$</configure --target=$(TARGET) --prefix=$(TOOLCHAIN_DIR)/inst; \
68 $(MAKE) all; $(MAKE) install
71 wget -N -P $(TOOLCHAIN_DIR)/dl $(GCC_URL)
72 tar -C $(TOOLCHAIN_DIR)/dl -xjf $(TOOLCHAIN_DIR)/dl/$(GCC_TAR)
73 patch -d $(TOOLCHAIN_DIR)/dl/$@ -p1 < local/patches/gcc.patch
76 mkdir -p $(TOOLCHAIN_DIR)/build/gcc
77 cd $(TOOLCHAIN_DIR)/build/gcc; \
78 export PATH=$(TOOLCHAIN_DIR)/inst/bin:$(PATH); \
79 $(TOOLCHAIN_DIR)/dl/$</configure --target=$(TARGET) --prefix=$(TOOLCHAIN_DIR)/inst \
80 --enable-languages=c --disable-libssp --disable-shared --disable-libquadmath \
81 --with-gmp=$(TOOLCHAIN_DIR)/inst \
82 --with-mpfr=$(TOOLCHAIN_DIR)/inst \
83 --with-mpc=$(TOOLCHAIN_DIR)/inst --with-newlib; \
84 $(MAKE) all; $(MAKE) install
86 toolchain: gmp mpfr mpc binutils gcc
89 rm -rf $(TOOLCHAIN_DIR)/build $(TOOLCHAIN_DIR)/inst