build-all-latest target
[external/binutils.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 include $(TREE)/release-info
10
11 TEST_INSTALL_DISK = /tug
12
13 INSTALLDIR = $(TEST_INSTALL_DISK)/$(TREE)-test/$(RELEASE_TAG)
14
15 ifndef host
16 host := $(shell $(TREE)/config.guess)
17 endif
18
19 NATIVE  = native
20
21 GCC      = gcc -O 
22 CFLAGS   = -g
23 CXXFLAGS = -g -O
24 MAKEINFOFLAGS =
25
26 log     = 1>$(canonhost)-build-log 2>&1
27 clog    = 1>$(canonhost)-check-log 2>&1
28 cyglog    = 1> $(canonhost)-x-$$i-cygnus-build-log 2>&1
29 latestlog = 1> $(canonhost)-x-$$i-latest-build-log 2>&1
30 natlog    = 1> $(canonhost)-x-$$i-native-build-log 2>&1
31
32 canonhost := $(shell $(TREE)/config.sub $(host))
33
34 # Convert config.guess results to a simpler form.
35 ifeq ($(canonhost),sparc-sun-solaris2.1)
36 canonhost := sparc-sun-solaris2
37 endif
38 ifeq ($(canonhost),mips-dec-ultrix4.2)
39 canonhost := mips-dec-ultrix
40 endif
41 ifeq ($(canonhost),mips-sgi-irix4.0.1)
42 canonhost := mips-sgi-irix4
43 endif
44 ifeq ($(canonhost),rs6000-ibm-aix3.2)
45 canonhost := rs6000-ibm-aix
46 endif
47 ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
48 canonhost := i386-sco3.2v4
49 endif
50 ifeq ($(canonhost),i386-unknown-sco3.2v4.0)
51 canonhost := i386-sco3.2v4
52 endif
53 ifeq ($(canonhost),i386-unknown-sco3.2v4)
54 canonhost := i386-sco3.2v4
55 endif
56 ifeq ($(canonhost),i386-unknown-go32)
57 canonhost := i386-go32
58 endif
59 ifeq ($(canonhost),i386-unknown-sysv4.2)
60 canonhost := i386-sysv4.2
61 endif
62 ifeq ($(canonhost),i386-lynx-lynxos)
63 canonhost := i386-lynxos
64 endif
65 ifeq ($(canonhost),m68k-lynx-lynxos)
66 canonhost := m68k-lynxos
67 endif
68
69 ifeq ($(canonhost),sparc-sun-sunos4.1.3)
70 TARGETS = $(NATIVE) \
71         i386-go32 \
72         a29k-amd-udi    \
73         h8300-hms       h8500-hms \
74         i386-aout       i386-coff \
75         i386-lynx       i386-netware \
76         i960-intel-nindy                i960-vxworks \
77         mips-idt-ecoff  \
78         m68k-aout       m68k-vxworks    m68k-coff \
79         m88k-coff \
80         sh-hms \
81         sparc-aout      sparc-vxworks   sparclite-aout \
82         z8k-coff
83 GCC = gcc -O -pipe
84 all: all-cygnus
85 endif
86
87 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
88 TARGETS = $(NATIVE) \
89         i960-intel-nindy \
90         m68k-aout       m68k-vxworks    m68k-coff 
91 GCC = gcc -O -msoft-float
92 CC = cc -J
93 all: all-cygnus
94 endif
95
96 ifeq ($(canonhost),sparc-sun-solaris2)
97 TARGETS = $(NATIVE) \
98         i386-aout \
99         i960-vxworks    i960-intel-nindy \
100         m68k-aout       m68k-coff       m68k-vxworks \
101         mips-idt-ecoff \
102         sparc-aout      sparc-vxworks   sparclite-aout \
103         h8300-hms       h8500-hms \
104         a29k-amd-udi \
105         i386-coff 
106 CC = cc -Xs
107 GCC = gcc -O -pipe
108 all: all-cygnus
109 endif
110
111 ifeq ($(canonhost),mips-dec-ultrix)
112 TARGETS = $(NATIVE) m68k-aout
113 CC = cc -Wf,-XNg1000
114 all: all-cygnus
115 endif
116
117 ifeq ($(canonhost),mips-sgi-irix4)
118 TARGETS = $(NATIVE) \
119         mips-idt-ecoff  sh-hms
120 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1500
121 all: all-cygnus
122 endif
123
124 ifeq ($(canonhost),rs6000-ibm-aix)
125 TARGETS = $(NATIVE) \
126         a29k-amd-udi    \
127         h8300-hms       h8500-hms \
128         i386-aout       i386-coff \
129         i386-lynx       i386-netware \
130         i960-intel-nindy                i960-vxworks \
131         mips-idt-ecoff  \
132         m68k-aout       m68k-vxworks    m68k-coff \
133         m88k-coff \
134         sh-hms \
135         sparc-aout      sparc-vxworks   sparclite-aout \
136         i386-go32 \
137         z8k-coff
138 all: all-cygnus
139 endif
140
141 ifeq ($(canonhost),m68k-hp-hpux)
142 TARGETS = $(NATIVE)     m68k-aout
143 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
144 CC = cc -Wp,-P 
145 #CFLAGS = +O1000 
146 CFLAGS = 
147 all: all-cygnus
148 endif
149
150 ifeq ($(canonhost),hppa1.1-hp-hpux)
151 TARGETS = \
152         i960-vxworks \
153         m68k-aout       m68k-vxworks 
154 #       sparc-aout      sparc-vxworks   sparclite-aout \
155 #       z8k-coff \
156 #       m88k-coff \
157 #       mips-idt-ecoff  \
158 #       h8300-hms       h8500-hms \
159 #       i386-aout       i386-coff \
160 #       i960-intel-nindy \
161 #       m68k-coff \
162 #       a29k-amd-udi    
163 #       sh-hms          # doesn't work
164 CC = cc 
165 #CFLAGS = +Obb2000
166 CFLAGS = -g
167 all: all-native
168 endif
169
170 ifeq ($(canonhost),i386-sco3.2v4)
171 TARGETS = $(NATIVE) i386-aout
172 all: all-cygnus
173 endif
174
175 ifeq ($(canonhost),i386-go32)
176 TARGETS = \p
177         a29k-amd-udi \
178         h8300-hms       h8500-hms \
179         i386-aout \
180         m68k-aout       m68k-coff \
181         mips-idt-ecoff \
182         sh-hms \
183         sparclite-aout
184 CC = i386-go32-gcc
185 GCC = i386-go32-gcc -O
186 CFLAGS =
187 CXXFLAGS = -O
188 MAKEINFOFLAGS = --no-split
189 all: all-cross
190 endif
191
192 ifeq ($(canonhost),i386-sysv4.2)
193 TARGETS = $(NATIVE) 
194 CC = cc
195 all: all-cygnus
196 endif
197
198 #ifeq ($(canonhost),i386-sysv4.2)
199 #TARGETS = $(NATIVE) \
200 #       a29k-amd-udi    \
201 #       h8300-hms       h8500-hms \
202 #       i386-aout       i386-coff \
203 #       i960-intel-nindy                i960-vxworks \
204 #       mips-idt-ecoff  \
205 #       m68k-aout       m68k-vxworks    m68k-coff \
206 #       m88k-coff \
207 #       sh-hms \
208 #       sparc-aout      sparc-vxworks   sparclite-aout \
209 #       z8k-sim         z8k-coff
210 #CC = cc
211 #all: all-cygnus
212 #endif
213
214 ifeq ($(canonhost),i386-lynxos)
215 TARGETS = $(NATIVE)
216 CC = /bin/gcc
217 all: all-cygnus
218 endif
219
220 ifeq ($(canonhost),m68k-lynxos)
221 TARGETS = $(NATIVE)
222 CC = /bin/gcc
223 all: all-cygnus
224 endif
225
226
227 FLAGS_TO_PASS := \
228         "GCC=$(GCC)" \
229         "CC=$(CC)" \
230         "CFLAGS=$(CFLAGS)" \
231         "CXXFLAGS=$(CXXFLAGS)" \
232         "host=$(canonhost)" \
233         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
234         "RELEASE_TAG=$(RELEASE_TAG)"
235
236 all-emacs:
237         @echo build started at `date`
238         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
239         -rm -f $(ROOTING)/$(RELEASE_TAG)
240         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
241         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-emacs-native-log 2>&1 
242         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-emacs-latest-log 2>&1 
243         @echo done at `date`
244
245 all-cygnus:
246         @echo build started at `date`
247         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
248         -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
249         @for i in $(TARGETS) ; do \
250           if [ "$$i" = "native" ] ; then \
251             if [ ! -f $(canonhost)-stamp-3stage-done ] ; then \
252               echo "3staging $(canonhost) native" ; \
253               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
254                  echo "     completed successfully" ; \
255             else \
256               true ; \
257             fi \
258           else \
259             echo "building $(canonhost) cross to $$i" ; \
260             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(cyglog) && \
261                echo "     completed successfully" ; \
262           fi ; \
263         done
264         @if [ ! -f $(canonhost)-stamp-3stage-checked ] ; then \
265           echo checking $(canonhost) native ; \
266           $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-check-3stage $(clog) ; \
267           touch $(canonhost)-stamp-3stage-checked ; \
268         else \
269           true ; \
270         fi
271         @echo done at `date`
272
273 native:
274         @echo build started at `date`
275         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
276         rm -f $(ROOTING)/$(RELEASE_TAG)
277         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
278         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
279         @echo done at `date`
280
281 build-cygnus:
282         @echo build started at `date`
283         @for i in $(TARGETS) ; do \
284           if [ "$$i" = "native" ] ; then \
285             if [ ! -f $(canonhost)-3stage-done ] ; then \
286               echo "3staging $(canonhost) native" ; \
287               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
288                  echo "     completed successfully" ; \
289             fi \
290           else \
291             echo "building $(canonhost) cross to $$i:" `date` ; \
292             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
293                echo "     completed successfully" ; \
294           fi ; \
295         done
296         @echo done at `date`
297
298 build-latest:
299         @echo build started at `date`
300         @for i in $(TARGETS) ; do \
301           if [ "$$i" != "native" ] ; then \
302             echo "building $(canonhost) cross to $$i:" `date` ; \
303             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(latestlog) && \
304                echo "     completed successfully" ; \
305           fi ; \
306         done
307         @echo done at `date`
308
309 all-native:
310         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
311         rm -f $(ROOTING)/$(RELEASE_TAG)
312         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
313         @for i in $(TARGETS) ; do \
314             echo "building $(canonhost) cross to $$i" ; \
315             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(natlog) && \
316                echo "     completed successfully" ; \
317         done
318
319 all-cross:
320         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
321         rm -f $(ROOTING)/$(RELEASE_TAG)
322         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
323         @for i in $(TARGETS) ; do \
324             echo "building $(canonhost) cross to $$i" ; \
325             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(cyglog) && \
326                echo "     completed successfully" ; \
327         done
328
329 config:
330         @for i in $(TARGETS) ; do \
331           if [ "$$i" = "native" ] ; then \
332             echo "config stage1 for $(canonhost)" ; \
333             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
334                echo "     completed successfully" ; \
335           else \
336             echo "config $(canonhost) cross to $$i" ; \
337             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(cyglog) && \
338                echo "     completed successfully" ;  \
339           fi ; \
340         done
341
342
343 build:
344         @for i in $(TARGETS) ; do \
345           if [ "$$i" = "native" ] ; then \
346             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
347                echo "     completed successfully" ; \
348           else \
349             echo "building $(canonhost) cross to $$i" ; \
350             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(natlog) && \
351                echo "     completed successfully" ; \
352           fi ; \
353         done
354
355
356 3build:
357         @for i in $(TARGETS) ; do \
358           if [ "$$i" = "native" ] ; then \
359             echo "building 3stage for $(canonhost)" ; \
360             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
361                echo "     completed successfully" ; \
362           else \
363             echo "building $(canonhost) cross to $$i" ; \
364             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
365                echo "     completed successfully" ; \
366           fi ; \
367         done
368
369 build-all-latest:
370         @for i in $(TARGETS) ; do \
371           if [ "$$i" = "native" ] ; then \
372             echo "building 3stage for $(canonhost)" ; \
373             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
374                echo "     completed successfully" ; \
375           else \
376             echo "building $(canonhost) cross to $$i" ; \
377             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(cyglog) && \
378                echo "     completed successfully" ; \
379           fi ; \
380         done
381
382 ### Local Variables:
383 ### fill-column: 131
384 ### End: