From 779d5ee32546c66e5a027a525e856022166a48d3 Mon Sep 17 00:00:00 2001 From: Morten Delenk Date: Sun, 23 Apr 2017 11:24:31 +0000 Subject: [PATCH] added cross compiler build --- .gitignore | 5 +++++ cross/Makefile | 31 +++++++++++++++++++++++++++++++ cross/binutils.mk | 29 +++++++++++++++++++++++++++++ cross/cloog.mk | 18 ++++++++++++++++++ cross/gawk.mk | 31 +++++++++++++++++++++++++++++++ cross/gcc.mk | 30 ++++++++++++++++++++++++++++++ cross/gmp.mk | 18 ++++++++++++++++++ cross/isl.mk | 18 ++++++++++++++++++ cross/mpc.mk | 18 ++++++++++++++++++ cross/mpfr.mk | 18 ++++++++++++++++++ 10 files changed, 216 insertions(+) create mode 100644 .gitignore create mode 100644 cross/Makefile create mode 100644 cross/binutils.mk create mode 100644 cross/cloog.mk create mode 100644 cross/gawk.mk create mode 100644 cross/gcc.mk create mode 100644 cross/gmp.mk create mode 100644 cross/isl.mk create mode 100644 cross/mpc.mk create mode 100644 cross/mpfr.mk diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..550f776 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.tar.* +gcc/ +binutils/ +gawk/ +builddir/ diff --git a/cross/Makefile b/cross/Makefile new file mode 100644 index 0000000..d05510b --- /dev/null +++ b/cross/Makefile @@ -0,0 +1,31 @@ +CROSSPATH = $(HOME)/opt +export PATH := $(CROSSPATH)/bin:$(PATH) +pre: | clean $(CROSSPATH)/ fetch extract patch prereqs + +clean: + rm -rf $(CROSSPATH) + rm -rf gawk binutils gcc *.tar.* builddir + +$(CROSSPATH)/: + mkdir -p $(CROSSPATH) + +include gawk.mk +include gcc.mk +include binutils.mk +include mpc.mk +include mpfr.mk +include gmp.mk +include isl.mk +include cloog.mk + +fetch: gawk.tar.xz gcc.tar.bz2 binutils.tar.bz2 mpc.tar.gz mpfr.tar.xz gmp.tar.xz isl.tar.xz cloog.tar.gz + +extract: gawk/ binutils/ gcc/mpc/ gcc/mpfr/ gcc/gmp/ gcc/isl/ gcc/cloog/ + +patch: gawk-patch gcc-patch binutils-patch mpc-patch mpfr-patch gmp-patch isl-patch cloog-patch + +prereqs: gawk-build + +build: + TARGET=$(TARGET) $(MAKE) -e binutils-build + TARGET=$(TARGET) $(MAKE) -e gcc-build diff --git a/cross/binutils.mk b/cross/binutils.mk new file mode 100644 index 0000000..bca12e1 --- /dev/null +++ b/cross/binutils.mk @@ -0,0 +1,29 @@ +BINUTILS_VERSION=2.28 +binutils.tar.bz2: binutils-$(BINUTILS_VERSION).tar.bz2 + mv $^ $@ + +binutils-$(BINUTILS_VERSION).tar.bz2: + wget https://ftp.gnu.org/gnu/binutils/$@ + +binutils/: binutils-$(BINUTILS_VERSION)/ + mv $^ $@ + +binutils-$(BINUTILS_VERSION)/: binutils.tar.bz2 + tar -xf $^ + +binutils-patch: + true + +binutils-build: binutils-install + rm -rf builddir + +binutils-configure: + mkdir builddir + cd builddir; \ + ../binutils/configure --prefix=$(CROSSPATH) --target=$(TARGET) --with-sysroot --disable-nls --disable-werror + +binutils-make: binutils-configure + $(MAKE) -C builddir + +binutils-install: binutils-make + $(MAKE) -C builddir install diff --git a/cross/cloog.mk b/cross/cloog.mk new file mode 100644 index 0000000..b1e4285 --- /dev/null +++ b/cross/cloog.mk @@ -0,0 +1,18 @@ +CLOOG_VERSION=0.18.4 +cloog.tar.gz: cloog-$(CLOOG_VERSION).tar.gz + mv $^ $@ + +cloog-$(CLOOG_VERSION).tar.gz: + wget http://www.bastoul.net/cloog/pages/download/$@ + +gcc/cloog/: gcc/ cloog-$(CLOOG_VERSION)/ + mv cloog-$(CLOOG_VERSION)/ $@ + +cloog-$(CLOOG_VERSION)/: cloog.tar.gz + tar -xf $^ + +cloog-patch: + true + +cloog-build: + true diff --git a/cross/gawk.mk b/cross/gawk.mk new file mode 100644 index 0000000..322b216 --- /dev/null +++ b/cross/gawk.mk @@ -0,0 +1,31 @@ +GAWK_VERSION=4.1.4 +gawk.tar.xz: gawk-$(GAWK_VERSION).tar.xz + mv $^ $@ + +gawk-$(GAWK_VERSION).tar.xz: + wget https://ftp.gnu.org/gnu/gawk/$@ + +gawk/: gawk-$(GAWK_VERSION)/ + mv $^ $@ + +gawk-$(GAWK_VERSION)/: gawk.tar.xz + tar -xf $^ + +gawk-patch: + true + +gawk-build: gawk-install + rm -rf builddir + +gawk-configure: gawk/ + mkdir builddir + cd builddir; \ + ../gawk/configure --prefix=$(CROSSPATH) + +gawk-make: gawk-configure + cd builddir; \ + $(MAKE) + +gawk-install: gawk-make + cd builddir; \ + $(MAKE) install diff --git a/cross/gcc.mk b/cross/gcc.mk new file mode 100644 index 0000000..9c3941a --- /dev/null +++ b/cross/gcc.mk @@ -0,0 +1,30 @@ +GCC_VERSION=6.3.0 +GCC_MAJOR_VERSION=6.3.0 +gcc.tar.bz2: gcc-$(GCC_VERSION).tar.bz2 + mv $^ $@ + +gcc-$(GCC_VERSION).tar.bz2: + wget https://ftp.gnu.org/gnu/gcc/gcc-$(GCC_MAJOR_VERSION)/$@ + +gcc/: gcc-$(GCC_VERSION)/ + mv $^ $@ + +gcc-$(GCC_VERSION)/: gcc.tar.bz2 + tar -xf $^ + +gcc-patch: + true #Todo: Replace this with the sed that enables libstdc++ + +gcc-build: gcc-install + rm -rf builddir + +gcc-configure: + mkdir builddir + cd builddir; \ + ../gcc/configure --prefix=$(CROSSPATH) --target=$(TARGET) --disable-nls --enable-languages=c,c++ --without-headers + +gcc-make: gcc-configure + $(MAKE) -C builddir all-gcc all-target-libgcc + +gcc-install: gcc-make + $(MAKE) -C builddir install-gcc install-target-libgcc diff --git a/cross/gmp.mk b/cross/gmp.mk new file mode 100644 index 0000000..87f48c1 --- /dev/null +++ b/cross/gmp.mk @@ -0,0 +1,18 @@ +GMP_VERSION=6.1.2 +gmp.tar.xz: gmp-$(GMP_VERSION).tar.xz + mv $^ $@ + +gmp-$(GMP_VERSION).tar.xz: + wget https://ftp.gnu.org/gnu/gmp/$@ + +gcc/gmp/: gcc/ gmp-$(GMP_VERSION)/ + mv gmp-$(GMP_VERSION) $@ + +gmp-$(GMP_VERSION)/: gmp.tar.xz + tar -xf $^ + +gmp-patch: + true + +gmp-build: + true diff --git a/cross/isl.mk b/cross/isl.mk new file mode 100644 index 0000000..b531d67 --- /dev/null +++ b/cross/isl.mk @@ -0,0 +1,18 @@ +ISL_VERSION=0.18 +isl.tar.xz: isl-$(ISL_VERSION).tar.xz + mv $^ $@ + +isl-$(ISL_VERSION).tar.xz: + wget http://isl.gforge.inria.fr/$@ + +gcc/isl/: gcc/ isl-$(ISL_VERSION)/ + mv isl-$(ISL_VERSION)/ $@ + +isl-$(ISL_VERSION)/: isl.tar.xz + tar -xf $^ + +isl-patch: + true + +isl-build: + true diff --git a/cross/mpc.mk b/cross/mpc.mk new file mode 100644 index 0000000..6ab51c2 --- /dev/null +++ b/cross/mpc.mk @@ -0,0 +1,18 @@ +MPC_VERSION=1.0.3 +mpc.tar.gz: mpc-$(MPC_VERSION).tar.gz + mv $^ $@ + +mpc-$(MPC_VERSION).tar.gz: + wget https://ftp.gnu.org/gnu/mpc/$@ + +gcc/mpc/: gcc/ mpc-$(MPC_VERSION)/ + mv mpc-$(MPC_VERSION)/ $@ + +mpc-$(MPC_VERSION)/: mpc.tar.gz + tar -xf $^ + +mpc-patch: + true + +mpc-build: + true diff --git a/cross/mpfr.mk b/cross/mpfr.mk new file mode 100644 index 0000000..298954a --- /dev/null +++ b/cross/mpfr.mk @@ -0,0 +1,18 @@ +MPFR_VERSION=3.1.5 +mpfr.tar.xz: mpfr-$(MPFR_VERSION).tar.xz + mv $^ $@ + +mpfr-$(MPFR_VERSION).tar.xz: + wget https://ftp.gnu.org/gnu/mpfr/$@ + +gcc/mpfr/: gcc/ mpfr-$(MPFR_VERSION)/ + mv mpfr-$(MPFR_VERSION)/ $@ + +mpfr-$(MPFR_VERSION)/: mpfr.tar.xz + tar -xf $^ + +mpfr-patch: + true + +mpfr-build: + true