added cross compiler build

This commit is contained in:
Morten Delenk 2017-04-23 11:24:31 +00:00
commit 779d5ee325
10 changed files with 216 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
*.tar.*
gcc/
binutils/
gawk/
builddir/

31
cross/Makefile Normal file
View file

@ -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

29
cross/binutils.mk Normal file
View file

@ -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

18
cross/cloog.mk Normal file
View file

@ -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

31
cross/gawk.mk Normal file
View file

@ -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

30
cross/gcc.mk Normal file
View file

@ -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

18
cross/gmp.mk Normal file
View file

@ -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

18
cross/isl.mk Normal file
View file

@ -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

18
cross/mpc.mk Normal file
View file

@ -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

18
cross/mpfr.mk Normal file
View file

@ -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