summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJoerg Koenig <jck@techsat.com>2017-11-08 11:14:38 (GMT)
committerJoerg Koenig <jck@techsat.com>2017-11-08 11:14:38 (GMT)
commite4c17a382593714e42171d99d8963f691c3f18b7 (patch)
treea3a15bfff0d049640e5b31f435a72fca4ae8ef56 /Makefile
parentd407e09d669cb65287816dbe99b163448452d135 (diff)
downloadcrossppc-e4c17a382593714e42171d99d8963f691c3f18b7.zip
crossppc-e4c17a382593714e42171d99d8963f691c3f18b7.tar.gz
crossppc-e4c17a382593714e42171d99d8963f691c3f18b7.tar.bz2
Switched to working gcc 2.95.4 and binutils 2.10.1; Only 32-Bit Compiler supported
Change-Id: I22a948e77bab02451539a1f5a280420e5e71a8ee
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile80
1 files changed, 60 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index df574ca..960769d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,14 @@
+#######################################################################
+#
+# Makefile to build a linux hosted PPC cross compiler for
+# PPC vxWorks 5.5.1 / Tornado 2.2.1
+#
+# Note:
+# To build the toolchain on newer linux systems,
+# we need to temporary install 'sed' and 'bison' to be
+# compatible for gcc configure and make scripts.
+#
+#######################################################################
CWD = $(shell readlink -f .)
ifeq ($(BUILD_NUMBER),)
@@ -15,10 +26,10 @@ HOST=i686-pc-linux-gnu
GCC_TARGET=powerpc-wrs-vxworks55
MASCH=$(shell uname -m)
INSTDIR=$(CWD)/inst/crossppc
-GCC_VERSION=3.0.4
-LANGUAGES=c
-PACKAGE=$(CWD)/vxw55-crossppc-$(GCC_VERSION)-$(BUILD_NO)-$(HOST).tar.gz
-
+GCC_VERSION=2.95.3
+GCC_TARGET_VERSION=2.95.4
+LANGUAGES=c,c++
+PACKAGE=$(CWD)/vxw55-crossppc-$(GCC_TARGET_VERSION)-$(BUILD_NO)-$(HOST).tar.gz
ifeq ($(WIND_BASE),)
$(error WIND_BASE not specified )
@@ -27,38 +38,63 @@ endif
JOBS=-j4
-all: prepare binutils xgcc pack clean
+all: prepare mktools binutils xgcc uninsttools pack clean
prepare:
mkdir -p $(BUILDDIR)
mkdir -p $(INSTDIR)
rm -Rf $(CWD)/unpacked
- mkdir -p $(CWD)/unpacked
+ mkdir -p $(CWD)/unpacked/sys-includes
+ cp -Rvf $(WIND_BASE)/target/h/* $(CWD)/unpacked/sys-includes
+ cd $(CWD)/unpacked/sys-includes/sys && \
+ patch -p0 < $(SRCDIR)/fdmatch.patch
cd $(CWD)/unpacked && \
- tar -zxf $(SRCDIR)/gcc-$(GCC_VERSION).tar.gz
- cd $(CWD)/unpacked/gcc-$(GCC_VERSION) && \
- patch -p1 < $(SRCDIR)/gcc304.patch
- cd $(CWD)/unpacked/gcc-$(GCC_VERSION) && \
- patch -p2 < $(SRCDIR)/gcc304.patch.2
+ tar -zxf $(SRCDIR)/gcc-2.95.3.tar.gz
cd $(CWD)/unpacked/gcc-$(GCC_VERSION) && \
- patch -p1 < $(SRCDIR)/gcc304.patch.3
+ patch -p1 < $(SRCDIR)/gcc2.95.3-2.95.4vxw55.patch
+ cd $(CWD)/unpacked && \
+ tar -zxf $(SRCDIR)/sed-3.02.tar.gz
+ cd $(CWD)/unpacked && \
+ tar -zxf $(SRCDIR)/bison-1.28.tar.gz
cd $(CWD)/unpacked && \
tar -zxf $(SRCDIR)/binutils-2.10.1.tar.gz
cd $(CWD)/unpacked/binutils-* && \
patch -p1 < $(SRCDIR)/vx-ppc-binutils-2.10.diff
+mktools:
+ cd $(CWD)/unpacked/sed-* && \
+ CC="gcc -m32 -std=gnu89" \
+ CXX="g++ -m32" \
+ ./configure --prefix=$(INSTDIR) && \
+ make && make install
+ cd $(CWD)/unpacked/bison-* && \
+ CC="gcc -m32 -std=gnu89" \
+ CXX="g++ -m32" \
+ ./configure --prefix=$(INSTDIR) && \
+ make && make install
+
+uninsttools:
+ cd $(CWD)/unpacked/sed-* && \
+ make uninstall
+ cd $(CWD)/unpacked/bison-* && \
+ make uninstall
+
binutils:
rm -Rf $(BUILDDIR)/binutils
mkdir -p $(BUILDDIR)/binutils
cd $(BUILDDIR)/binutils && \
- CFLAGS="-m32" LDFLAGS="-m32" \
+ export PATH=$(INSTDIR)/bin:$(PATH) && \
+ CC="gcc -m32 -std=gnu89" \
+ CXX="g++ -m32" \
+ HOST_LD_FLAGS="-m32" \
$(CWD)/unpacked/binutils-2.10.1/configure \
- --build=$(HOST) \
- --host=$(HOST) \
- --prefix=$(INSTDIR) \
- --target=$(GCC_TARGET) \
- --with-headers=$(WIND_BASE)/target/h \
+ --build=$(HOST) \
+ --host=$(HOST) \
+ --prefix=$(INSTDIR) \
+ --target=$(GCC_TARGET) \
+ --with-headers=$(CWD)/unpacked/sys-includes \
--with-libs=$(WIND_BASE)/target/lib
cd $(BUILDDIR)/binutils && \
+ export PATH=$(INSTDIR)/bin:$(PATH) && \
make $(JOBS) && \
make install
@@ -69,13 +105,17 @@ xgcc:
export WIND_BASE=$(WIND_BASE) && \
export WIND_USR=$(WIND_USR) && \
export PATH=$(INSTDIR)/bin:$(PATH) && \
- CC="gcc -m32" CXX="g++ -m32" HOST_CXXFLAGS="-m32" HOST_CFLAGS="-m32" HOST_LD_FLAGS="-m32" \
+ export YACC="$(INSTDIR)/bin/bison -y" && \
+ bison --version && \
+ CC="gcc -m32 -std=gnu89" \
+ CXX="g++ -m32" \
+ HOST_LD_FLAGS="-m32" \
$(CWD)/unpacked/gcc-$(GCC_VERSION)/configure \
--build=$(HOST) \
--host=$(HOST) \
--prefix=$(INSTDIR) \
--target=$(GCC_TARGET) \
- --with-headers=$(WIND_BASE)/target/h \
+ --with-headers=$(CWD)/unpacked/sys-includes \
--with-libs=$(WIND_BASE)/target/lib \
--enable-languages="$(LANGUAGES)" \
--disable-multilib \