* build-all.mk: Set GCC to gcc -O -G 8 for MIPS targets, since gcc
[binutils-gdb.git] / build-all.mk
1 # Build all of the targets for any given host.....
2 #
3 # This file is going to be ugly. It will be VERY specific to the
4 # Cygnus environment and build-process.
5 #
6 #
7
8 TREE = devo
9
10 NATIVE = native
11
12 DATE = 930401
13
14 TAG = latest-$(DATE)
15
16 INSTALLDIR = /build/ian/devo-test/$(TAG)
17
18 ifndef host
19 host := $(shell $(TREE)/config.guess)
20 endif
21
22 GCC = gcc -O
23 CFLAGS = -g
24
25 log = 1>$(canonhost)-build-log 2>&1
26 tlog = 1> $(canonhost)-x-$$i-build-log 2>&1
27
28 canonhost := $(shell $(TREE)/config.sub $(host))
29
30 # Convert config.guess results to a simpler form.
31 ifeq ($(canonhost),mips-dec-ultrix4.2)
32 canonhost := mips-dec-ultrix
33 endif
34 ifeq ($(canonhost),mips-sgi-irix4.0.1)
35 canonhost := mips-sgi-irix4
36 endif
37 ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
38 canonhost := i386-sco3.2v4
39 endif
40
41 ifeq ($(canonhost),sparc-sun-sunos4.1.1)
42 TARGETS = $(NATIVE) m68k-aout i386-aout a29k-amd-udi \
43 i960-vxworks m68k-coff m68k-vxworks \
44 i960-intel-nindy sparc-aout sparc-vxworks \
45 sparclite-aout sparclitefrwcompat-aout
46 all: all-cygnus
47 endif
48
49 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
50 TARGETS = $(NATIVE) m68k-vxworks m68k-aout i386-aout
51 GCC = gcc -O -msoft-float
52 CC = cc -J
53 all: all-cygnus
54 endif
55
56 ifeq ($(canonhost),sparc-sun-solaris2)
57 TARGETS = $(NATIVE) m68k-aout sparc-aout a29k-amd-udi
58 CC = cc -Xs
59 all: all-cygnus
60 endif
61
62 ifeq ($(canonhost),mips-dec-ultrix)
63 TARGETS = $(NATIVE) m68k-vxworks m68k-aout i960-vxworks \
64 sparc-vxworks m68k-coff i386-aout sparc-aout i960-intel-nindy
65 GCC = gcc -O -G 8
66 CC = cc -Wf,-XNg1000
67 all: all-cygnus
68 endif
69
70 ifeq ($(canonhost),mips-sgi-irix4)
71 TARGETS = $(NATIVE) m68k-vxworks a29k-amd-udi
72 GCC = gcc -O -G 8
73 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1500
74 all: all-cygnus
75 endif
76
77 ifeq ($(canonhost),rs6000-ibm-aix)
78 TARGETS = $(NATIVE) m68k-vxworks i960-vxworks m68k-aout
79 all: all-cygnus
80 endif
81
82 ifeq ($(canonhost),m68k-hp-hpux)
83 TARGETS = m68k-vxworks
84 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
85 CC = cc +O1000 -Wp,-P
86 CFLAGS =
87 all: all-native
88 endif
89
90 ifeq ($(canonhost),hppa1.1-hp-hpux)
91 #TARGETS = m68k-aout m68k-coff m68k-vxworks i960-vxworks a29k-amd-udi
92 TARGETS = m68k-aout i386-aout a29k-amd-udi \
93 i960-vxworks m68k-coff m68k-vxworks \
94 sparc-aout sparc-vxworks \
95 sparclite-aout sparclitefrwcompat-aout
96 CC = cc
97 all: all-native
98 endif
99
100 ifeq ($(canonhost),i386-sco3.2v4)
101 TARGETS = $(NATIVE) i386-aout
102 all: all-cygnus
103 endif
104
105 FLAGS_TO_PASS := \
106 "GCC=$(GCC)" \
107 "CC=$(CC)" \
108 "CFLAGS=$(CFLAGS)" \
109 "host=$(canonhost)" \
110 "RELEASE_TAG=$(TAG)"
111
112 all-cygnus:
113 @echo build started at `date`
114 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
115 rm -f /usr/cygnus/$(TAG)
116 ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
117 @for i in $(TARGETS) ; do \
118 if [ "$$i" = "native" ] ; then \
119 if [ ! -f $(canonhost)-3stage-done ] ; then \
120 echo "3staging $(canonhost) native" ; \
121 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
122 echo " completed successfully" ; \
123 fi \
124 else \
125 echo "building $(canonhost) cross to $$i" ; \
126 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
127 echo " completed successfully" ; \
128 fi ; \
129 done
130 @echo done at `date`
131
132 native:
133 @echo build started at `date`
134 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
135 rm -f /usr/cygnus/$(TAG)
136 ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
137 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
138 @echo done at `date`
139
140 build-cygnus:
141 @echo build started at `date`
142 @for i in $(TARGETS) ; do \
143 if [ "$$i" = "native" ] ; then \
144 if [ ! -f $(canonhost)-3stage-done ] ; then \
145 echo "3staging $(canonhost) native" ; \
146 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
147 echo " completed successfully" ; \
148 fi \
149 else \
150 echo "building $(canonhost) cross to $$i:" `date` ; \
151 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
152 echo " completed successfully" ; \
153 fi ; \
154 done
155 @echo done at `date`
156
157 all-native:
158 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
159 rm -f /usr/cygnus/$(TAG)
160 ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
161 @for i in $(TARGETS) ; do \
162 echo "building $(canonhost) cross to $$i" ; \
163 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
164 echo " completed successfully" ; \
165 done
166
167 config:
168 @for i in $(TARGETS) ; do \
169 if [ "$$i" = "native" ] ; then \
170 echo "config stage1 for $(canonhost)" ; \
171 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
172 echo " completed successfully" ; \
173 else \
174 echo "config $(canonhost) cross to $$i" ; \
175 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
176 echo " completed successfully" ; \
177 fi ; \
178 done
179
180
181 build:
182 @for i in $(TARGETS) ; do \
183 if [ "$$i" = "native" ] ; then \
184 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
185 echo " completed successfully" ; \
186 else \
187 echo "building $(canonhost) cross to $$i" ; \
188 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
189 echo " completed successfully" ; \
190 fi ; \
191 done
192
193
194 3build:
195 @for i in $(TARGETS) ; do \
196 if [ "$$i" = "native" ] ; then \
197 echo "building 3stage for $(canonhost)" ; \
198 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
199 echo " completed successfully" ; \
200 else \
201 echo "building $(canonhost) cross to $$i" ; \
202 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
203 echo " completed successfully" ; \
204 fi ; \
205 done
206
207 ### Local Variables:
208 ### fill-column: 131
209 ### End: