cfree -> free
[deliverable/binutils-gdb.git] / build-all.mk
CommitLineData
543cf4ac
DZ
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#
85195426
DE
6# Useful targets (rt = recursion target):
7# (please correct or expand on this)
8# FIXME: Might some of these be superfluous?
543cf4ac 9#
85195426
DE
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 native and 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)
44c1515d
DE
32# clean - remove objdir directories, stamp files
33# (rt = clean)
85195426
DE
34#
35# To configure/build for fewer targets, specify TARGETS="native cross1 ...".
36
543cf4ac 37TREE = devo
022f8f67 38include $(TREE)/release-info
543cf4ac 39
323f277f 40TEST_INSTALL_DISK = /abc
543cf4ac 41
022f8f67 42INSTALLDIR = $(TEST_INSTALL_DISK)/$(TREE)-test/$(RELEASE_TAG)
543cf4ac 43
12eda620
ILT
44ifndef host
45host := $(shell $(TREE)/config.guess)
46endif
47
022f8f67
DZ
48NATIVE = native
49
a846e83d 50GCC = gcc -O2
e87f9243 51CFLAGS = -g
a846e83d 52CXXFLAGS = -g -O2 -fexternal-templates
9823504d 53MAKEINFOFLAGS =
543cf4ac
DZ
54
55log = 1>$(canonhost)-build-log 2>&1
0689f73a 56clog = 1>$(canonhost)-check-log 2>&1
f74859e4 57cyglog = 1> $(canonhost)-x-$$i-cygnus-build-log 2>&1
39ad69d8 58latestlog = 1> $(canonhost)-x-$$i-latest-build-log 2>&1
f74859e4 59natlog = 1> $(canonhost)-x-$$i-native-build-log 2>&1
543cf4ac
DZ
60
61canonhost := $(shell $(TREE)/config.sub $(host))
12eda620
ILT
62
63# Convert config.guess results to a simpler form.
89da237f
ILT
64ifeq ($(canonhost),sparc-sun-solaris2.1)
65canonhost := sparc-sun-solaris2
66endif
85195426
DE
67ifeq ($(canonhost),sparc-sun-solaris2.3)
68canonhost := sparc-sun-solaris2
69endif
12eda620
ILT
70ifeq ($(canonhost),mips-dec-ultrix4.2)
71canonhost := mips-dec-ultrix
72endif
73ifeq ($(canonhost),mips-sgi-irix4.0.1)
74canonhost := mips-sgi-irix4
75endif
85195426
DE
76ifeq ($(canonhost),mips-sgi-irix4.0.5H)
77canonhost := mips-sgi-irix4
78endif
db526bd7
ILT
79ifeq ($(canonhost),rs6000-ibm-aix3.2)
80canonhost := rs6000-ibm-aix
81endif
12eda620 82ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
21412832
ILT
83canonhost := i386-sco3.2v4
84endif
ec782faa
DZ
85ifeq ($(canonhost),i386-unknown-sco3.2v4.0)
86canonhost := i386-sco3.2v4
87endif
08629ab8
DZ
88ifeq ($(canonhost),i386-unknown-sco3.2v4)
89canonhost := i386-sco3.2v4
90endif
60986901
ILT
91ifeq ($(canonhost),i386-unknown-go32)
92canonhost := i386-go32
93endif
89745e93
DZ
94ifeq ($(canonhost),i386-unknown-sysv4.2)
95canonhost := i386-sysv4.2
96endif
f358c814 97ifeq ($(canonhost),i386-lynx-lynxos)
8456a631 98canonhost := i386-lynx
f358c814
DZ
99endif
100ifeq ($(canonhost),m68k-lynx-lynxos)
8456a631 101canonhost := m68k-lynx
f358c814 102endif
c5a1c226
KC
103ifeq ($(canonhost),sparc-lynx-lynxos)
104canonhost := sparc-lynx
105endif
106ifeq ($(canonhost),rs6000-lynx-lynxos)
055cc3ff
KC
107canonhost := rs6000-lynx
108endif
543cf4ac 109
32480238
DZ
110ifeq ($(canonhost),sparc-sun-sunos4.1.3)
111TARGETS = $(NATIVE) \
d5b2cb76 112 i386-go32 \
32480238 113 a29k-amd-udi \
d5b2cb76
DZ
114 h8300-hms \
115 i386-aout \
116 i386-lynx \
8456a631 117 i960-vxworks \
055cc3ff 118 mips-idt-ecoff mips64-elf mips-elf \
32480238 119 m68k-aout m68k-vxworks m68k-coff \
d5b2cb76
DZ
120 m68k-lynx \
121 sh-hms \
055cc3ff 122 sparc-aout sparc-lynx sparc-vxworks \
d5b2cb76 123 sparclite-aout sparclite-vxworks \
8456a631 124 sparclite-coff z8k-coff
a846e83d 125GCC = gcc -O2 -pipe
543cf4ac
DZ
126all: all-cygnus
127endif
128
129ifeq ($(canonhost),m68k-sun-sunos4.1.1)
32480238 130TARGETS = $(NATIVE) \
a4c50dd0 131 m68k-coff
a846e83d 132GCC = gcc -O2 -msoft-float
7cc2923a 133CC = cc -J
543cf4ac
DZ
134all: all-cygnus
135endif
136
137ifeq ($(canonhost),sparc-sun-solaris2)
32480238 138TARGETS = $(NATIVE) \
d5b2cb76 139 a29k-amd-udi \
a4c50dd0 140 i960-vxworks \
8456a631
KC
141 m68k-aout m68k-coff m68k-vxworks \
142 m88k-coff \
055cc3ff 143 mipsel-idt-ecoff sparc-lynx
6d98b3d2 144CC = cc -Xs
a846e83d 145GCC = gcc -O2 -pipe
543cf4ac
DZ
146all: all-cygnus
147endif
148
149ifeq ($(canonhost),mips-dec-ultrix)
e110c2a8 150TARGETS = $(NATIVE) m68k-aout
872ff7ef 151CC = cc -Wf,-XNg1000
543cf4ac
DZ
152all: all-cygnus
153endif
154
155ifeq ($(canonhost),mips-sgi-irix4)
89745e93 156TARGETS = $(NATIVE) \
055cc3ff
KC
157 mips-idt-ecoff sh-hms \
158 mips64-elf
fea15001 159CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000
543cf4ac
DZ
160all: all-cygnus
161endif
162
163ifeq ($(canonhost),rs6000-ibm-aix)
32480238 164TARGETS = $(NATIVE) \
a4c50dd0
KC
165 i960-vxworks \
166 m68k-aout
543cf4ac
DZ
167all: all-cygnus
168endif
169
170ifeq ($(canonhost),m68k-hp-hpux)
07be0634 171TARGETS = $(NATIVE) m68k-aout
e37dbf93 172TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
32480238
DZ
173CC = cc -Wp,-P
174#CFLAGS = +O1000
c262769a 175CFLAGS =
eb0293dc 176all: all-cygnus
543cf4ac
DZ
177endif
178
179ifeq ($(canonhost),hppa1.1-hp-hpux)
32480238 180TARGETS = \
d5b2cb76 181 $(NATIVE) \
323f277f
KC
182 i960-vxworks m68k-aout \
183 m68k-coff m68k-vxworks
055cc3ff 184CC = cc -Wp,-H256000
32480238
DZ
185#CFLAGS = +Obb2000
186CFLAGS = -g
055cc3ff 187all: all-cygnus
543cf4ac
DZ
188endif
189
21412832
ILT
190ifeq ($(canonhost),i386-sco3.2v4)
191TARGETS = $(NATIVE) i386-aout
21412832
ILT
192all: all-cygnus
193endif
194
60986901 195ifeq ($(canonhost),i386-go32)
d5b2cb76 196TARGETS = \
32480238 197 a29k-amd-udi \
d5b2cb76
DZ
198 h8300-hms \
199 i386-aout \
32480238 200 m68k-aout m68k-coff \
d5b2cb76
DZ
201 mips-idt-ecoff \
202 sh-hms \
32480238 203 sparclite-aout
60986901 204CC = i386-go32-gcc
a846e83d 205GCC = i386-go32-gcc -O2
9823504d 206CFLAGS =
a846e83d 207CXXFLAGS = -O2
9823504d 208MAKEINFOFLAGS = --no-split
055cc3ff 209all: all-dos
60986901
ILT
210endif
211
7f82101d 212ifeq ($(canonhost),i386-sysv4.2)
a4c50dd0 213TARGETS = $(NATIVE) i386-netware
32480238
DZ
214CC = cc
215all: all-cygnus
216endif
217
8456a631 218ifeq ($(canonhost),i386-lynx)
f358c814 219TARGETS = $(NATIVE)
756b40d5 220CC = /usr/cygnus/progressive/bin/gcc
f358c814 221all: all-cygnus
fb682d69 222SHELL=/bin/bash
f358c814
DZ
223endif
224
8456a631 225ifeq ($(canonhost),m68k-lynx)
f358c814 226TARGETS = $(NATIVE)
756b40d5 227CC = /usr/cygnus/progressive/bin/gcc
f358c814 228all: all-cygnus
fb682d69 229SHELL=/bin/bash
f358c814
DZ
230endif
231
055cc3ff
KC
232ifeq ($(canonhost),sparc-lynx)
233TARGETS = $(NATIVE)
756b40d5 234CC = /usr/cygnus/progressive/bin/gcc
055cc3ff
KC
235all: all-cygnus
236SHELL=/bin/bash
237endif
238
239ifeq ($(canonhost),rs6000-lynx)
240TARGETS = $(NATIVE)
b5775df3 241CC = /usr/cygnus/progressive/bin/gcc
055cc3ff
KC
242all: all-cygnus
243SHELL=/bin/bash
244endif
245
543cf4ac
DZ
246FLAGS_TO_PASS := \
247 "GCC=$(GCC)" \
7cc2923a 248 "CC=$(CC)" \
543cf4ac 249 "CFLAGS=$(CFLAGS)" \
e87f9243 250 "CXXFLAGS=$(CXXFLAGS)" \
12eda620 251 "host=$(canonhost)" \
9823504d 252 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
fb682d69
ME
253 "RELEASE_TAG=$(RELEASE_TAG)" \
254 "SHELL=$(SHELL)"
543cf4ac 255
7ae68194
ME
256# set GNU_MAKE and CONFIG_SHELL correctly in sub-builds
257ifeq ($(patsubst %-lynxos,lynxos,$(canonhost)),lynxos)
258FLAGS_TO_PASS := $(FLAGS_TO_PASS) "GNU_MAKE=$(MAKE)" "CONFIG_SHELL=/bin/bash"
259endif
260
57dfb584
DZ
261all-emacs:
262 @echo build started at `date`
263 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
f358c814 264 -rm -f $(ROOTING)/$(RELEASE_TAG)
022f8f67 265 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
08629ab8
DZ
266 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-emacs-native-log 2>&1
267 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-emacs-latest-log 2>&1
57dfb584
DZ
268 @echo done at `date`
269
543cf4ac
DZ
270all-cygnus:
271 @echo build started at `date`
272 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
c262769a 273 -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
c5a1c226
KC
274#
275# The following line to be used during regular progressive builds
276# to help developers test, but should be commented out for final
277# progressive build.
278#
01626b4e 279# -rm -f $(ROOTING)/progressive-beta && ln -s $(RELEASE_TAG) $(ROOTING)/progresssive
543cf4ac
DZ
280 @for i in $(TARGETS) ; do \
281 if [ "$$i" = "native" ] ; then \
75217b36 282 if [ ! -f $(canonhost)-stamp-3stage-done ] ; then \
543cf4ac 283 echo "3staging $(canonhost) native" ; \
21412832 284 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
543cf4ac 285 echo " completed successfully" ; \
75217b36
ILT
286 else \
287 true ; \
1900e815 288 fi ; \
543cf4ac
DZ
289 else \
290 echo "building $(canonhost) cross to $$i" ; \
f74859e4 291 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(cyglog) && \
543cf4ac
DZ
292 echo " completed successfully" ; \
293 fi ; \
294 done
0689f73a
ME
295 @if [ ! -f $(canonhost)-stamp-3stage-checked ] ; then \
296 echo checking $(canonhost) native ; \
297 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-check-3stage $(clog) ; \
298 touch $(canonhost)-stamp-3stage-checked ; \
299 else \
300 true ; \
301 fi
543cf4ac
DZ
302 @echo done at `date`
303
c676f606
DZ
304native:
305 @echo build started at `date`
306 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
c5a1c226
KC
307 -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
308# -rm -f $(ROOTING)/progressive-beta && ln -s $(RELEASE_TAG) $(ROOTING)/progressive-beta
21412832 309 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
c676f606
DZ
310 @echo done at `date`
311
5ba00487
DZ
312build-cygnus:
313 @echo build started at `date`
314 @for i in $(TARGETS) ; do \
315 if [ "$$i" = "native" ] ; then \
316 if [ ! -f $(canonhost)-3stage-done ] ; then \
317 echo "3staging $(canonhost) native" ; \
21412832 318 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
5ba00487 319 echo " completed successfully" ; \
1900e815 320 fi ; \
5ba00487 321 else \
13ec8aad 322 echo "building $(canonhost) cross to $$i:" `date` ; \
f74859e4 323 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
5ba00487
DZ
324 echo " completed successfully" ; \
325 fi ; \
326 done
327 @echo done at `date`
328
39ad69d8
DZ
329build-latest:
330 @echo build started at `date`
331 @for i in $(TARGETS) ; do \
332 if [ "$$i" != "native" ] ; then \
333 echo "building $(canonhost) cross to $$i:" `date` ; \
334 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(latestlog) && \
335 echo " completed successfully" ; \
336 fi ; \
337 done
338 @echo done at `date`
339
543cf4ac
DZ
340all-native:
341 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
022f8f67
DZ
342 rm -f $(ROOTING)/$(RELEASE_TAG)
343 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
543cf4ac
DZ
344 @for i in $(TARGETS) ; do \
345 echo "building $(canonhost) cross to $$i" ; \
f74859e4 346 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(natlog) && \
543cf4ac
DZ
347 echo " completed successfully" ; \
348 done
349
60986901
ILT
350all-cross:
351 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
a9377e86
ILT
352 rm -f $(ROOTING)/$(RELEASE_TAG)
353 ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
60986901
ILT
354 @for i in $(TARGETS) ; do \
355 echo "building $(canonhost) cross to $$i" ; \
f74859e4 356 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(cyglog) && \
60986901
ILT
357 echo " completed successfully" ; \
358 done
359
8456a631
KC
360do-dos:
361 $(MAKE) -f build-all.mk build=$(host) host=i386-go32 all-dos
362all-dos:
363 @for i in $(TARGETS) ; do \
364 echo "building $(canonhost) cross to $$i" ; \
055cc3ff 365 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) host=$(host) target=$$i do-dos $(cyglog) && \
8456a631
KC
366 echo " completed successfully at `date`" ; \
367 done
368
543cf4ac
DZ
369config:
370 @for i in $(TARGETS) ; do \
371 if [ "$$i" = "native" ] ; then \
372 echo "config stage1 for $(canonhost)" ; \
373 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
374 echo " completed successfully" ; \
375 else \
376 echo "config $(canonhost) cross to $$i" ; \
f74859e4 377 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(cyglog) && \
543cf4ac
DZ
378 echo " completed successfully" ; \
379 fi ; \
380 done
381
382
383build:
384 @for i in $(TARGETS) ; do \
385 if [ "$$i" = "native" ] ; then \
386 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
387 echo " completed successfully" ; \
388 else \
389 echo "building $(canonhost) cross to $$i" ; \
c262769a 390 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(natlog) && \
543cf4ac
DZ
391 echo " completed successfully" ; \
392 fi ; \
393 done
394
395
3963build:
397 @for i in $(TARGETS) ; do \
398 if [ "$$i" = "native" ] ; then \
399 echo "building 3stage for $(canonhost)" ; \
400 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
401 echo " completed successfully" ; \
402 else \
403 echo "building $(canonhost) cross to $$i" ; \
f74859e4 404 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
543cf4ac
DZ
405 echo " completed successfully" ; \
406 fi ; \
407 done
408
87c6c079
DZ
409build-all-latest:
410 @for i in $(TARGETS) ; do \
411 if [ "$$i" = "native" ] ; then \
412 echo "building 3stage for $(canonhost)" ; \
413 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
414 echo " completed successfully" ; \
415 else \
416 echo "building $(canonhost) cross to $$i" ; \
417 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(cyglog) && \
418 echo " completed successfully" ; \
419 fi ; \
420 done
421
44c1515d
DE
422clean:
423 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) clean $(log)
424
543cf4ac
DZ
425### Local Variables:
426### fill-column: 131
427### End:
This page took 0.105914 seconds and 4 git commands to generate.