blob: df574ca1b3390d486aa45fd5aa802238e96ab904 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
CWD = $(shell readlink -f .)
ifeq ($(BUILD_NUMBER),)
BUILD_NO=0
else
BUILD_NO=$(BUILD_NUMBER)
endif
VERSION=0.4.1
SRCDIR=$(CWD)/SOURCES
BUILDDIR=$(CWD)/build
#WIND_BASE=$(HOME)/tornado/2.2.1
WIND_USR=$(WIND_BASE)/target
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
ifeq ($(WIND_BASE),)
$(error WIND_BASE not specified )
endif
JOBS=-j4
all: prepare binutils xgcc pack clean
prepare:
mkdir -p $(BUILDDIR)
mkdir -p $(INSTDIR)
rm -Rf $(CWD)/unpacked
mkdir -p $(CWD)/unpacked
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
cd $(CWD)/unpacked/gcc-$(GCC_VERSION) && \
patch -p1 < $(SRCDIR)/gcc304.patch.3
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
binutils:
rm -Rf $(BUILDDIR)/binutils
mkdir -p $(BUILDDIR)/binutils
cd $(BUILDDIR)/binutils && \
CFLAGS="-m32" LDFLAGS="-m32" \
$(CWD)/unpacked/binutils-2.10.1/configure \
--build=$(HOST) \
--host=$(HOST) \
--prefix=$(INSTDIR) \
--target=$(GCC_TARGET) \
--with-headers=$(WIND_BASE)/target/h \
--with-libs=$(WIND_BASE)/target/lib
cd $(BUILDDIR)/binutils && \
make $(JOBS) && \
make install
xgcc:
rm -Rf $(BUILDDIR)/gcc
mkdir -p $(BUILDDIR)/gcc
cd $(BUILDDIR)/gcc && \
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" \
$(CWD)/unpacked/gcc-$(GCC_VERSION)/configure \
--build=$(HOST) \
--host=$(HOST) \
--prefix=$(INSTDIR) \
--target=$(GCC_TARGET) \
--with-headers=$(WIND_BASE)/target/h \
--with-libs=$(WIND_BASE)/target/lib \
--enable-languages="$(LANGUAGES)" \
--disable-multilib \
--with-gnu-as --with-gnu-ld
cd $(BUILDDIR)/gcc && \
export WIND_BASE=$(WIND_BASE) && \
export WIND_USR=$(WIND_USR) && \
export PATH=$(INSTDIR)/bin:$(PATH) && \
make $(JOBS) && \
make install
rm -Rf $(INSTDIR)/$(GCC_TARGET)/sys-include
rm -f $(INSTDIR)/bin/powerpc-wrs-vxworks55-gccbug
strip $(INSTDIR)/bin/$(GCC_TARGET)-*
pack:
cd $(INSTDIR) && \
tar -zcf $(PACKAGE) .
clean:
rm -Rf $(BUILDDIR)
rm -Rf $(CWD)/unpacked
rm -Rf $(CWD)/inst
|