Mon Feb 2 19:22:15 1998 Steve Haworth <steve@pm.cse.rmit.EDU.AU>
[deliverable/binutils-gdb.git] / build-all.mk
... / ...
CommitLineData
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
37TREE = devo
38include $(TREE)/release-info
39
40TEST_INSTALL_DISK = /dumbo
41
42INSTALLDIR = $(TEST_INSTALL_DISK)/$(TREE)-test/$(RELEASE_TAG)
43
44ifndef host
45host := $(shell $(TREE)/config.guess)
46endif
47
48NATIVE = native
49
50GCC = gcc
51CFLAGS = -g
52GNUCFLAGS= -g -O2
53CXXFLAGS = -g -O2
54MAKEINFOFLAGS =
55
56log = 1>$(canonhost)-build-log 2>&1
57clog = 1>$(canonhost)-check-log 2>&1
58cyglog = 1> $(canonhost)-x-$$i-cygnus-build-log 2>&1
59latestlog = 1> $(canonhost)-x-$$i-latest-build-log 2>&1
60natlog = 1> $(canonhost)-x-$$i-native-build-log 2>&1
61
62canonhost := $(shell $(TREE)/config.sub $(host))
63
64# Convert config.guess results to a simpler form.
65ifeq ($(canonhost),sparc-sun-solaris2.1)
66canonhost := sparc-sun-solaris2
67endif
68ifeq ($(canonhost),sparc-sun-solaris2.3)
69canonhost := sparc-sun-solaris2
70endif
71ifeq ($(canonhost),mips-dec-ultrix4.2)
72canonhost := mips-dec-ultrix
73endif
74ifeq ($(canonhost),mips-dec-ultrix4.4)
75canonhost := mips-dec-ultrix
76endif
77ifeq ($(canonhost),mips-sgi-irix4.0.1)
78canonhost := mips-sgi-irix4
79endif
80ifeq ($(canonhost),mips-sgi-irix4.0.5H)
81canonhost := mips-sgi-irix4
82endif
83ifeq ($(canonhost),mips-sgi-irix5.2)
84canonhost := mips-sgi-irix5
85endif
86ifeq ($(canonhost),rs6000-ibm-aix3.2)
87canonhost := rs6000-ibm-aix
88endif
89ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
90canonhost := i386-sco3.2v4
91endif
92ifeq ($(canonhost),i386-unknown-sco3.2v4.0)
93canonhost := i386-sco3.2v4
94endif
95ifeq ($(canonhost),i386-unknown-sco3.2v4)
96canonhost := i386-sco3.2v4
97endif
98ifeq ($(canonhost),i386-unknown-go32)
99canonhost := i386-go32
100endif
101ifeq ($(canonhost),i386-unknown-sysv4.2)
102canonhost := i386-sysv4.2
103endif
104ifeq ($(canonhost),i386-lynx-lynxos)
105canonhost := i386-lynx
106endif
107ifeq ($(canonhost),m68k-lynx-lynxos)
108canonhost := m68k-lynx
109endif
110ifeq ($(canonhost),sparc-lynx-lynxos)
111canonhost := sparc-lynx
112endif
113ifeq ($(canonhost),rs6000-lynx-lynxos)
114canonhost := rs6000-lynx
115endif
116ifeq ($(canonhost),i386-unknown-linux)
117canonhost := i386-linux
118endif
119ifeq ($(canonhost),i486-unknown-linux)
120canonhost := i486-linux
121endif
122ifeq ($(canonhost),i586-unknown-linux)
123canonhost := i486-linux
124endif
125ifeq ($(canonhost),i386-unknown-linuxaout)
126canonhost := i386-linuxaout
127endif
128ifeq ($(canonhost),i486-unknown-linuxaout)
129canonhost := i486-linuxaout
130endif
131ifeq ($(canonhost),i586-unknown-linuxaout)
132canonhost := i486-linuxaout
133endif
134
135#
136# The following TARGETS variable settings probably ought to
137# be made automatically from the
138# /s1/cygnus/progressive/host-target-pairs.tbl file, using
139# the /s1/cygnus/progressive/targets script. But, be sure
140# that the native is spelled 'native'.
141#
142
143ifeq ($(canonhost),sparc-sun-sunos4.1)
144TARGETS = $(NATIVE) \
145 i386-go32 \
146 a29k-amd-udi a29k-vxworks5.1 \
147 sh-hms h8300-hms \
148 powerpc-eabi hppa1.1-hp-proelf \
149 i386-aout i386-elf \
150 i960-nindy-coff i960-vxworks5.0 i960-vxworks5.1 \
151 m68k-aout m68k-coff m68k-elf m68k-vxworks5.1 \
152 mips-elf mips-idt-ecoff mips64-elf \
153 sparc-aout sparclite-aout sparclite-coff \
154 z8k-coff i386-unixware mips-ncd-elf \
155 OSE68000 OSE68k
156GCC = gcc -O2 -pipe
157all: all-cygnus
158endif
159
160ifeq ($(canonhost),sparc-sun-sunos4.1.3)
161TARGETS = $(NATIVE) \
162 i386-go32 \
163 a29k-amd-udi \
164 h8300-hms h8500-hms \
165 hppa1.1-hp-proelf \
166 i386-aout i386-elf \
167 i960-nindy-coff i960-vxworks5.0 i960-vxworks5.1 \
168 m68k-aout m68k-coff m68k-elf m68k-vxworks5.1 \
169 mips-idt-ecoff mips64-elf mips-elf \
170 sh-hms \
171 sparc-aout sparc64-aout sparc-vxworks \
172 sparclite-aout sparclite-coff sparclite-vxworks \
173 z8k-coff \
174 OSE68000 OSE68k mips-ncd-elf i386-unixware
175# The OSE68000 and OSE68k targets are for Ericsson only.
176GCC = gcc -O2 -pipe
177all: all-cygnus
178endif
179
180ifeq ($(canonhost),m68k-sun-sunos4.1.1)
181TARGETS = $(NATIVE)
182GCC = gcc -O2 -msoft-float
183CC = cc -J
184all: all-cygnus
185endif
186
187ifeq ($(canonhost),sparc-sun-solaris2)
188TARGETS = $(NATIVE) \
189 a29k-amd-udi \
190 h8300-hms h8500-hms \
191 hppa1.1-hp-proelf \
192 i960-vxworks5.0 i960-vxworks5.1 \
193 m68k-aout m68k-coff m68k-vxworks5.1 m88k-coff \
194 mips-idt-ecoff mips-elf \
195 sparc64-elf sparclite-aout sparclite-coff \
196 OSE68000 OSE68k \
197 sparc-sun-sunos4.1.3
198# The latter assures that BNR's special build (which they now
199# do for themselves from sources) hasn't developed bit-rot.
200# The OSE68000 and OSE68k targets are for Ericsson only.
201
202CC = cc
203GCC = gcc -O2 -pipe
204all: all-cygnus
205endif
206
207ifeq ($(canonhost),mips-dec-ultrix)
208TARGETS = $(NATIVE)
209CC = cc -Wf,-XNg1000
210all: all-cygnus
211SHELL = /usr/unsupported/bin/bash
212CONFIG_SHELL = /usr/unsupported/bin/bash
213TMPDIR = $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
214endif
215
216ifeq ($(patsubst alpha-dec-osf%,alpha,$(canonhost)),alpha)
217TARGETS = $(NATIVE)
218CC = cc
219all: all-cygnus
220endif
221
222ifeq ($(canonhost),mips-sgi-irix4)
223TARGETS = $(NATIVE) \
224 mips-idt-ecoff \
225 mips-elf mips64-elf \
226 sh-hms
227CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
228all: all-cygnus
229endif
230
231ifeq ($(canonhost),mips-sgi-irix5)
232TARGETS = $(NATIVE) \
233 mips-idt-ecoff \
234 mips-elf mips64-elf \
235 sh-hms
236CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
237all: all-cygnus
238endif
239
240ifeq ($(canonhost),powerpc-ibm-aix4.1)
241TARGETS = $(NATIVE)
242all: all-cygnus
243endif
244
245ifeq ($(canonhost),rs6000-ibm-aix)
246TARGETS = $(NATIVE) \
247 i960-vxworks5.0 i960-vxworks5.1 \
248 m68k-aout
249all: all-cygnus
250endif
251
252ifeq ($(canonhost),rs6000-ibm-aix3.2.5)
253TARGETS = $(NATIVE) \
254 i960-vxworks5.0 i960-vxworks5.1 \
255 m68k-aout
256all: all-cygnus
257endif
258
259ifeq ($(canonhost),rs6000-ibm-aix4.1)
260TARGETS = $(NATIVE)
261all: all-cygnus
262endif
263
264ifeq ($(canonhost),m68k-hp-hpux9)
265TARGETS = $(NATIVE)
266TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
267CC = cc -Wp,-P,-H256000
268#CFLAGS = +O1000
269CFLAGS = -g
270all: all-cygnus
271endif
272
273ifeq ($(canonhost),hppa1.1-hp-hpux9)
274TARGETS = \
275 $(NATIVE) \
276 h8300-hms \
277 hppa1.1-hp-proelf \
278 i960-vxworks5.0 i960-vxworks5.1 \
279 m68k-aout m68k-coff m68k-vxworks5.1
280CC = cc -Wp,-H256000
281#CFLAGS = +Obb2000
282CFLAGS = -g
283all: all-cygnus
284endif
285
286#ifeq ($(canonhost),hppa1.1-hp-hpux10)
287ifeq ($(patsubst hppa1.1-hp-hpux10%,hpux10,$(canonhost)),hpux10)
288TARGETS = $(NATIVE)
289CC = cc -Wp,-H256000
290#CFLAGS = +Obb2000
291CFLAGS = -g
292all: all-cygnus
293endif
294
295ifeq ($(canonhost),i386-sco3.2v4)
296TARGETS = $(NATIVE)
297all: all-cygnus
298endif
299
300ifeq ($(canonhost),i386-go32)
301TARGETS = \
302 a29k-amd-udi \
303 h8300-hms hppa1.1-hp-proelf \
304 i386-aout \
305 m68k-aout m68k-coff \
306 mips-elf mips-idt-ecoff mips64-elf \
307 sh-hms \
308 sparc-aout sparclite-aout sparclite-coff
309CC = i386-go32-gcc
310GCC = i386-go32-gcc -O2
311CFLAGS =
312CXXFLAGS = -O2
313MAKEINFOFLAGS = --no-split
314all: all-dos
315endif
316
317ifeq ($(canonhost),i386-sysv4.2)
318TARGETS = $(NATIVE) i386-netware
319CC = cc
320all: all-cygnus
321endif
322
323ifeq ($(canonhost),i386-ncr-sysv4.3)
324TARGETS = $(NATIVE)
325CC = cc -Hnocopyr
326SHELL = /usr/unsupported/bin/bash
327CONFIG_SHELL = /usr/unsupported/bin/bash
328all: all-cygnus
329endif
330
331ifeq ($(canonhost),i386-lynx)
332TARGETS = $(NATIVE)
333CC = /usr/cygnus/progressive/bin/gcc
334all: all-cygnus
335SHELL=/bin/bash
336endif
337
338ifeq ($(canonhost),m68k-lynx)
339TARGETS = $(NATIVE)
340CC = /usr/cygnus/progressive/bin/gcc
341all: all-cygnus
342SHELL=/bin/bash
343endif
344
345ifeq ($(canonhost),sparc-lynx)
346TARGETS = $(NATIVE)
347CC = /usr/cygnus/progressive/bin/gcc
348all: all-cygnus
349SHELL=/bin/bash
350endif
351
352ifeq ($(canonhost),rs6000-lynx)
353TARGETS = $(NATIVE)
354CC = /usr/cygnus/progressive/bin/gcc
355all: all-cygnus
356SHELL=/bin/bash
357endif
358
359ifeq ($(patsubst %-linux,linux,$(patsubst %-linuxaout,linux,$(canonhost))),linux)
360TARGETS = $(NATIVE)
361all: all-cygnus
362endif
363
364FLAGS_TO_PASS := \
365 "GCC=$(GCC)" \
366 "CC=$(CC)" \
367 "CFLAGS=$(CFLAGS)" \
368 "GNUCFLAGS=$(GNUCFLAGS)" \
369 "CXXFLAGS=$(CXXFLAGS)" \
370 "host=$(canonhost)" \
371 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
372 "RELEASE_TAG=$(RELEASE_TAG)" \
373 "SHELL=$(SHELL)"
374
375# set GNU_MAKE and CONFIG_SHELL correctly in sub-builds
376ifeq ($(patsubst %-lynx,lynx,$(canonhost)),lynx)
377FLAGS_TO_PASS := $(FLAGS_TO_PASS) "GNU_MAKE=$(MAKE)" "CONFIG_SHELL=/bin/bash"
378endif
379
380ifeq ($(patsubst %-linux,linux,$(patsubst %-linuxaout,linux,$(canonhost))),linux)
381FLAGS_TO_PASS := $(FLAGS_TO_PASS) "GNU_MAKE=$(MAKE)"
382endif
383
384ifeq ($(patsubst %i386-ncr-sysv4.3,ncr,$(canonhost)),ncr)
385FLAGS_TO_PASS := $(FLAGS_TO_PASS) "CONFIG_SHELL=/usr/unsupported/bin/bash"
386endif
387
388all-emacs:
389 @echo build started at `date`
390 test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
391 -rm -f $(ROOTING)/$(RELEASE_TAG)
392 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
393 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-emacs-native-log 2>&1
394 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-emacs-latest-log 2>&1
395 @echo done at `date`
396
397all-cygnus:
398 @echo build started at `date`
399 test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
400 -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
401#
402# The following line to be used during regular progressive builds
403# to help developers test, but should be commented out for final
404# progressive build.
405#
406# -rm -f $(ROOTING)/progressive-beta && ln -s $(RELEASE_TAG) $(ROOTING)/progresssive
407 @for i in $(TARGETS) ; do \
408 if [ "$$i" = "native" ] ; then \
409 if [ ! -f $(canonhost)-stamp-3stage-done ] ; then \
410 echo "3staging $(canonhost) native" ; \
411 echo Flags passed to make: $(FLAGS_TO_PASS) ; \
412 if $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log); then \
413 echo " completed successfully" ; \
414 else \
415 exit 1; \
416 fi; \
417 else \
418 true ; \
419 fi ; \
420 else \
421 echo "building $(canonhost) cross to $$i" ; \
422 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(cyglog) && \
423 echo " completed successfully" ; \
424 fi ; \
425 done
426 @if [ ! -f $(canonhost)-stamp-3stage-checked ] ; then \
427 echo checking $(canonhost) native ; \
428 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-check-3stage $(clog) ; \
429 touch $(canonhost)-stamp-3stage-checked ; \
430 else \
431 true ; \
432 fi
433 @echo done at `date`
434
435native:
436 @echo build started at `date`
437 test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
438 -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
439# -rm -f $(ROOTING)/progressive-beta && ln -s $(RELEASE_TAG) $(ROOTING)/progressive-beta
440 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
441 @echo done at `date`
442
443build-cygnus:
444 @echo build started at `date`
445 @for i in $(TARGETS) ; do \
446 if [ "$$i" = "native" ] ; then \
447 if [ ! -f $(canonhost)-3stage-done ] ; then \
448 echo "3staging $(canonhost) native" ; \
449 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
450 echo " completed successfully" ; \
451 fi ; \
452 else \
453 echo "building $(canonhost) cross to $$i:" `date` ; \
454 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
455 echo " completed successfully" ; \
456 fi ; \
457 done
458 @echo done at `date`
459
460build-latest:
461 @echo build started at `date`
462 @for i in $(TARGETS) ; do \
463 if [ "$$i" != "native" ] ; then \
464 echo "building $(canonhost) cross to $$i:" `date` ; \
465 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(latestlog) && \
466 echo " completed successfully" ; \
467 fi ; \
468 done
469 @echo done at `date`
470
471all-native:
472 test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
473 rm -f $(ROOTING)/$(RELEASE_TAG)
474 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
475 @for i in $(TARGETS) ; do \
476 echo "building $(canonhost) cross to $$i" ; \
477 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(natlog) && \
478 echo " completed successfully" ; \
479 done
480
481all-cross:
482 test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
483 rm -f $(ROOTING)/$(RELEASE_TAG)
484 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
485 @for i in $(TARGETS) ; do \
486 echo "building $(canonhost) cross to $$i" ; \
487 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(cyglog) && \
488 echo " completed successfully" ; \
489 done
490
491do-dos:
492 $(MAKE) -f build-all.mk build=$(host) host=i386-go32 all-dos
493all-dos:
494 @for i in $(TARGETS) ; do \
495 echo "building $(canonhost) cross to $$i" ; \
496 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) target=$$i do-dos $(cyglog) && \
497 echo " completed successfully at `date`" ; \
498 done
499
500config:
501 @for i in $(TARGETS) ; do \
502 if [ "$$i" = "native" ] ; then \
503 echo "config stage1 for $(canonhost)" ; \
504 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
505 echo " completed successfully" ; \
506 else \
507 echo "config $(canonhost) cross to $$i" ; \
508 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(cyglog) && \
509 echo " completed successfully" ; \
510 fi ; \
511 done
512
513
514build:
515 @for i in $(TARGETS) ; do \
516 if [ "$$i" = "native" ] ; then \
517 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
518 echo " completed successfully" ; \
519 else \
520 echo "building $(canonhost) cross to $$i" ; \
521 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(natlog) && \
522 echo " completed successfully" ; \
523 fi ; \
524 done
525
526
5273build:
528 @for i in $(TARGETS) ; do \
529 if [ "$$i" = "native" ] ; then \
530 echo "building 3stage for $(canonhost)" ; \
531 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
532 echo " completed successfully" ; \
533 else \
534 echo "building $(canonhost) cross to $$i" ; \
535 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
536 echo " completed successfully" ; \
537 fi ; \
538 done
539
540build-all-latest:
541 @for i in $(TARGETS) ; do \
542 if [ "$$i" = "native" ] ; then \
543 echo "building 3stage for $(canonhost)" ; \
544 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
545 echo " completed successfully" ; \
546 else \
547 echo "building $(canonhost) cross to $$i" ; \
548 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(cyglog) && \
549 echo " completed successfully" ; \
550 fi ; \
551 done
552
553clean:
554 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) clean $(log)
555
556### Local Variables:
557### fill-column: 131
558### End:
This page took 0.025139 seconds and 4 git commands to generate.