1fcfb92ebca0903833ac2038028eace035070c22
[deliverable/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 # Useful targets (rt = recursion target):
7 # (please correct or expand on this)
8 # FIXME: Might some of these be superfluous?
9 #
10 # all-emacs
11 # all-cygnus - set up install directories, build 3stage native and all
12 # supported cross targets, then check 3stage'd native
13 # (rt = $(canonhost)-stamp-3stage-done, do-cygnus for cross)
14 # native - set up install directories, build 3stage native
15 # (rt = $(canonhost)-stamp-3stage-1)
16 # build-cygnus - build 3stage native and all supported cross targets
17 # (rt = $(canonhost)-stamp-3stage-done, build-cygnus for cross)
18 # build-latest - build all supported cross targets
19 # (rt = build-latest)
20 # all-native - set up install directories, build native
21 # (rt = do-native)
22 # all-cross - set up install directories, build all targets
23 # (rt = do-cygnus)
24 # config - configure native and all supported cross targets
25 # (rt = do1-config, do-native-config for cross)
26 # build - build native and all supported cross targets
27 # (rt = do1-build, build-native for cross)
28 # 3build - build 3stage native and all supported cross targets
29 # (rt = all, build-cygnus for cross)
30 # build-all-latest - build 3stage native and all supported cross targets
31 # (rt = $(canonhost)-stamp-3stage-done, build-latest for cross)
32 # clean - remove objdir directories, stamp files
33 # (rt = clean)
34 #
35 # To configure/build for fewer targets, specify TARGETS="native cross1 ...".
36
37 TREE = devo
38 include $(TREE)/release-info
39
40 TEST_INSTALL_DISK = /abc
41
42 INSTALLDIR = $(TEST_INSTALL_DISK)/$(TREE)-test/$(RELEASE_TAG)
43
44 ifndef host
45 host := $(shell $(TREE)/config.guess)
46 endif
47
48 NATIVE = native
49
50 GCC = gcc -O2
51 CFLAGS = -g
52 CXXFLAGS = -g -O2 -fexternal-templates
53 MAKEINFOFLAGS =
54
55 log = 1>$(canonhost)-build-log 2>&1
56 clog = 1>$(canonhost)-check-log 2>&1
57 cyglog = 1> $(canonhost)-x-$$i-cygnus-build-log 2>&1
58 latestlog = 1> $(canonhost)-x-$$i-latest-build-log 2>&1
59 natlog = 1> $(canonhost)-x-$$i-native-build-log 2>&1
60
61 canonhost := $(shell $(TREE)/config.sub $(host))
62
63 # Convert config.guess results to a simpler form.
64 ifeq ($(canonhost),sparc-sun-solaris2.1)
65 canonhost := sparc-sun-solaris2
66 endif
67 ifeq ($(canonhost),sparc-sun-solaris2.3)
68 canonhost := sparc-sun-solaris2
69 endif
70 ifeq ($(canonhost),mips-dec-ultrix4.2)
71 canonhost := mips-dec-ultrix
72 endif
73 ifeq ($(canonhost),mips-sgi-irix4.0.1)
74 canonhost := mips-sgi-irix4
75 endif
76 ifeq ($(canonhost),mips-sgi-irix4.0.5H)
77 canonhost := mips-sgi-irix4
78 endif
79 ifeq ($(canonhost),mips-sgi-irix5.2)
80 canonhost := mips-sgi-irix5
81 endif
82 ifeq ($(canonhost),rs6000-ibm-aix3.2)
83 canonhost := rs6000-ibm-aix
84 endif
85 ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
86 canonhost := i386-sco3.2v4
87 endif
88 ifeq ($(canonhost),i386-unknown-sco3.2v4.0)
89 canonhost := i386-sco3.2v4
90 endif
91 ifeq ($(canonhost),i386-unknown-sco3.2v4)
92 canonhost := i386-sco3.2v4
93 endif
94 ifeq ($(canonhost),i386-unknown-go32)
95 canonhost := i386-go32
96 endif
97 ifeq ($(canonhost),i386-unknown-sysv4.2)
98 canonhost := i386-sysv4.2
99 endif
100 ifeq ($(canonhost),i386-lynx-lynxos)
101 canonhost := i386-lynx
102 endif
103 ifeq ($(canonhost),m68k-lynx-lynxos)
104 canonhost := m68k-lynx
105 endif
106 ifeq ($(canonhost),sparc-lynx-lynxos)
107 canonhost := sparc-lynx
108 endif
109 ifeq ($(canonhost),rs6000-lynx-lynxos)
110 canonhost := rs6000-lynx
111 endif
112
113 #
114 # The following TARGETS variable settings probably ought to
115 # be made automatically from the
116 # /s1/cygnus/progressive/host-target-pairs.tbl file, using
117 # the /s1/cygnus/progressive/targets script. But, be sure
118 # that the native is spelled 'native'.
119 #
120
121 ifeq ($(canonhost),sparc-sun-sunos4.1.3)
122 TARGETS = $(NATIVE) \
123 i386-go32 \
124 a29k-amd-udi \
125 h8300-hms \
126 i386-aout \
127 i386-lynx \
128 i960-vxworks5.0 i960-vxworks5.1 \
129 mips-idt-ecoff mips64-elf mips-elf \
130 m68k-aout m68k-vxworks m68k-coff \
131 m68k-lynx \
132 sh-hms \
133 sparc-aout sparc-lynx sparc-vxworks \
134 sparclite-aout sparclite-vxworks \
135 sparclite-coff z8k-coff \
136 OSE68000 OSE68k
137 # The OSE68000 and OSE68k targets are for Ericsson only.
138 GCC = gcc -O2 -pipe
139 all: all-cygnus
140 endif
141
142 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
143 TARGETS = $(NATIVE) \
144 m68k-coff
145 GCC = gcc -O2 -msoft-float
146 CC = cc -J
147 all: all-cygnus
148 endif
149
150 ifeq ($(canonhost),sparc-sun-solaris2)
151 TARGETS = $(NATIVE) \
152 a29k-amd-udi \
153 i960-vxworks5.0 i960-vxworks5.1 \
154 m68k-aout m68k-coff m68k-vxworks \
155 mipsel-idt-ecoff sparc-lynx \
156 sparclite-aout sparclite-coff m88k-coff z8k-coff \
157 OSE68000 OSE68k \
158 sparc-sun-sunos4.1.3
159 # The latter assures that BNR's special build (which they now
160 # do for themselves from sources) hasn't developed bit-rot.
161 # The OSE68000 and OSE68k targets are for Ericsson only.
162
163 CC = cc -Xs
164 GCC = gcc -O2 -pipe
165 all: all-cygnus
166 endif
167
168 ifeq ($(canonhost),mips-dec-ultrix)
169 TARGETS = $(NATIVE) m68k-aout
170 CC = cc -Wf,-XNg1000
171 all: all-cygnus
172 endif
173
174 ifeq ($(canonhost),alpha-dec-osf1.3)
175 TARGETS = $(NATIVE)
176 CC = cc
177 all: all-cygnus
178 endif
179
180 ifeq ($(canonhost),mips-sgi-irix4)
181 TARGETS = $(NATIVE) \
182 mips-idt-ecoff sh-hms \
183 mips64-elf
184 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
185 all: all-cygnus
186 endif
187
188 ifeq ($(canonhost),mips-sgi-irix5)
189 TARGETS = $(NATIVE) \
190 mips-idt-ecoff sh-hms \
191 mips64-elf
192 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
193 all: all-cygnus
194 endif
195
196 ifeq ($(canonhost),rs6000-ibm-aix)
197 TARGETS = $(NATIVE) \
198 i960-vxworks5.0 i960-vxworks5.1 \
199 m68k-aout
200 all: all-cygnus
201 endif
202
203 ifeq ($(canonhost),m68k-hp-hpux)
204 TARGETS = $(NATIVE) m68k-aout
205 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
206 CC = cc -Wp,-P
207 #CFLAGS = +O1000
208 CFLAGS = -g
209 all: all-cygnus
210 endif
211
212 ifeq ($(canonhost),hppa1.1-hp-hpux)
213 TARGETS = \
214 $(NATIVE) \
215 i960-vxworks5.0 i960-vxworks5.1 \
216 m68k-aout m68k-coff m68k-vxworks \
217 z8k-coff
218 CC = cc -Wp,-H256000
219 #CFLAGS = +Obb2000
220 CFLAGS = -g
221 all: all-cygnus
222 endif
223
224 ifeq ($(canonhost),i386-sco3.2v4)
225 TARGETS = $(NATIVE) i386-aout
226 all: all-cygnus
227 endif
228
229 ifeq ($(canonhost),i386-go32)
230 TARGETS = \
231 a29k-amd-udi \
232 h8300-hms \
233 i386-aout \
234 m68k-aout m68k-coff \
235 mips-idt-ecoff \
236 sh-hms \
237 sparclite-aout
238 CC = i386-go32-gcc
239 GCC = i386-go32-gcc -O2
240 CFLAGS =
241 CXXFLAGS = -O2
242 MAKEINFOFLAGS = --no-split
243 all: all-dos
244 endif
245
246 ifeq ($(canonhost),i386-sysv4.2)
247 TARGETS = $(NATIVE) i386-netware
248 CC = cc
249 all: all-cygnus
250 endif
251
252 ifeq ($(canonhost),i386-lynx)
253 TARGETS = $(NATIVE)
254 CC = /usr/cygnus/progressive/bin/gcc
255 all: all-cygnus
256 SHELL=/bin/bash
257 endif
258
259 ifeq ($(canonhost),m68k-lynx)
260 TARGETS = $(NATIVE)
261 CC = /usr/cygnus/progressive/bin/gcc
262 all: all-cygnus
263 SHELL=/bin/bash
264 endif
265
266 ifeq ($(canonhost),sparc-lynx)
267 TARGETS = $(NATIVE)
268 CC = /usr/cygnus/progressive/bin/gcc
269 all: all-cygnus
270 SHELL=/bin/bash
271 endif
272
273 ifeq ($(canonhost),rs6000-lynx)
274 TARGETS = $(NATIVE)
275 CC = /usr/cygnus/progressive/bin/gcc
276 all: all-cygnus
277 SHELL=/bin/bash
278 endif
279
280 FLAGS_TO_PASS := \
281 "GCC=$(GCC)" \
282 "CC=$(CC)" \
283 "CFLAGS=$(CFLAGS)" \
284 "CXXFLAGS=$(CXXFLAGS)" \
285 "host=$(canonhost)" \
286 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
287 "RELEASE_TAG=$(RELEASE_TAG)" \
288 "SHELL=$(SHELL)"
289
290 # set GNU_MAKE and CONFIG_SHELL correctly in sub-builds
291 ifeq ($(patsubst %-lynx,lynx,$(canonhost)),lynx)
292 FLAGS_TO_PASS := $(FLAGS_TO_PASS) "GNU_MAKE=$(MAKE)" "CONFIG_SHELL=/bin/bash"
293 endif
294
295 all-emacs:
296 @echo build started at `date`
297 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
298 -rm -f $(ROOTING)/$(RELEASE_TAG)
299 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
300 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-emacs-native-log 2>&1
301 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-emacs-latest-log 2>&1
302 @echo done at `date`
303
304 all-cygnus:
305 @echo build started at `date`
306 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
307 -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
308 #
309 # The following line to be used during regular progressive builds
310 # to help developers test, but should be commented out for final
311 # progressive build.
312 #
313 # -rm -f $(ROOTING)/progressive-beta && ln -s $(RELEASE_TAG) $(ROOTING)/progresssive
314 @for i in $(TARGETS) ; do \
315 if [ "$$i" = "native" ] ; then \
316 if [ ! -f $(canonhost)-stamp-3stage-done ] ; then \
317 echo "3staging $(canonhost) native" ; \
318 echo Flags passed to make: $(FLAGS_TO_PASS) ; \
319 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
320 echo " completed successfully" ; \
321 else \
322 true ; \
323 fi ; \
324 else \
325 echo "building $(canonhost) cross to $$i" ; \
326 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(cyglog) && \
327 echo " completed successfully" ; \
328 fi ; \
329 done
330 @if [ ! -f $(canonhost)-stamp-3stage-checked ] ; then \
331 echo checking $(canonhost) native ; \
332 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-check-3stage $(clog) ; \
333 touch $(canonhost)-stamp-3stage-checked ; \
334 else \
335 true ; \
336 fi
337 @echo done at `date`
338
339 native:
340 @echo build started at `date`
341 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
342 -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
343 # -rm -f $(ROOTING)/progressive-beta && ln -s $(RELEASE_TAG) $(ROOTING)/progressive-beta
344 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
345 @echo done at `date`
346
347 build-cygnus:
348 @echo build started at `date`
349 @for i in $(TARGETS) ; do \
350 if [ "$$i" = "native" ] ; then \
351 if [ ! -f $(canonhost)-3stage-done ] ; then \
352 echo "3staging $(canonhost) native" ; \
353 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
354 echo " completed successfully" ; \
355 fi ; \
356 else \
357 echo "building $(canonhost) cross to $$i:" `date` ; \
358 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
359 echo " completed successfully" ; \
360 fi ; \
361 done
362 @echo done at `date`
363
364 build-latest:
365 @echo build started at `date`
366 @for i in $(TARGETS) ; do \
367 if [ "$$i" != "native" ] ; then \
368 echo "building $(canonhost) cross to $$i:" `date` ; \
369 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(latestlog) && \
370 echo " completed successfully" ; \
371 fi ; \
372 done
373 @echo done at `date`
374
375 all-native:
376 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
377 rm -f $(ROOTING)/$(RELEASE_TAG)
378 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
379 @for i in $(TARGETS) ; do \
380 echo "building $(canonhost) cross to $$i" ; \
381 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(natlog) && \
382 echo " completed successfully" ; \
383 done
384
385 all-cross:
386 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
387 rm -f $(ROOTING)/$(RELEASE_TAG)
388 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
389 @for i in $(TARGETS) ; do \
390 echo "building $(canonhost) cross to $$i" ; \
391 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(cyglog) && \
392 echo " completed successfully" ; \
393 done
394
395 do-dos:
396 $(MAKE) -f build-all.mk build=$(host) host=i386-go32 all-dos
397 all-dos:
398 @for i in $(TARGETS) ; do \
399 echo "building $(canonhost) cross to $$i" ; \
400 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) target=$$i do-dos $(cyglog) && \
401 echo " completed successfully at `date`" ; \
402 done
403
404 config:
405 @for i in $(TARGETS) ; do \
406 if [ "$$i" = "native" ] ; then \
407 echo "config stage1 for $(canonhost)" ; \
408 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
409 echo " completed successfully" ; \
410 else \
411 echo "config $(canonhost) cross to $$i" ; \
412 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(cyglog) && \
413 echo " completed successfully" ; \
414 fi ; \
415 done
416
417
418 build:
419 @for i in $(TARGETS) ; do \
420 if [ "$$i" = "native" ] ; then \
421 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
422 echo " completed successfully" ; \
423 else \
424 echo "building $(canonhost) cross to $$i" ; \
425 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(natlog) && \
426 echo " completed successfully" ; \
427 fi ; \
428 done
429
430
431 3build:
432 @for i in $(TARGETS) ; do \
433 if [ "$$i" = "native" ] ; then \
434 echo "building 3stage for $(canonhost)" ; \
435 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
436 echo " completed successfully" ; \
437 else \
438 echo "building $(canonhost) cross to $$i" ; \
439 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
440 echo " completed successfully" ; \
441 fi ; \
442 done
443
444 build-all-latest:
445 @for i in $(TARGETS) ; do \
446 if [ "$$i" = "native" ] ; then \
447 echo "building 3stage for $(canonhost)" ; \
448 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
449 echo " completed successfully" ; \
450 else \
451 echo "building $(canonhost) cross to $$i" ; \
452 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(cyglog) && \
453 echo " completed successfully" ; \
454 fi ; \
455 done
456
457 clean:
458 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) clean $(log)
459
460 ### Local Variables:
461 ### fill-column: 131
462 ### End:
This page took 0.048398 seconds and 4 git commands to generate.