update for lynx, sgi -x- sh
[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 = /big
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 tlog    = 1> $(canonhost)-x-$$i-build-log 2>&1
28
29 canonhost := $(shell $(TREE)/config.sub $(host))
30
31 # Convert config.guess results to a simpler form.
32 ifeq ($(canonhost),sparc-sun-solaris2.1)
33 canonhost := sparc-sun-solaris2
34 endif
35 ifeq ($(canonhost),mips-dec-ultrix4.2)
36 canonhost := mips-dec-ultrix
37 endif
38 ifeq ($(canonhost),mips-sgi-irix4.0.1)
39 canonhost := mips-sgi-irix4
40 endif
41 ifeq ($(canonhost),rs6000-ibm-aix3.2)
42 canonhost := rs6000-ibm-aix
43 endif
44 ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
45 canonhost := i386-sco3.2v4
46 endif
47 ifeq ($(canonhost),i386-unknown-sco3.2v4.0)
48 canonhost := i386-sco3.2v4
49 endif
50 ifeq ($(canonhost),i386-unknown-go32)
51 canonhost := i386-go32
52 endif
53 ifeq ($(canonhost),i386-lynx-lynxos)
54 canonhost := i386-lynxos
55 endif
56 ifeq ($(canonhost),m68k-lynx-lynxos)
57 canonhost := m68k-lynxos
58 endif
59
60 ifeq ($(canonhost),sparc-sun-sunos4.1.3)
61 TARGETS = $(NATIVE) \
62         a29k-amd-udi    \
63         h8300-hms       h8500-hms \
64         i386-aout       i386-go32       i386-coff \
65         i960-vxworks    i960-intel-nindy \
66         mips-idt-ecoff  \
67         m68k-aout       m68k-vxworks    m68k-coff \
68         m88k-coff \
69         sh-hms \
70         sparc-aout      sparc-vxworks   sparclitefrwcompat-aout sparclite-aout \
71         z8k-sim         
72 GCC = gcc -O -pipe
73 all: all-cygnus
74 endif
75
76 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
77 TARGETS = $(NATIVE) \
78         i960-intel-nindy \
79         m68k-aout       m68k-vxworks    m68k-coff       i960
80 GCC = gcc -O -msoft-float
81 CC = cc -J
82 all: all-cygnus
83 endif
84
85 ifeq ($(canonhost),sparc-sun-solaris2)
86 TARGETS = $(NATIVE) \
87         a29k-amd-udi \
88         m68k-vxworks    m68k-coff       m68k-aout \
89         mips-idt-ecoff \
90         i386-aout \
91         i960-vxworks    i960-intel-nindy \
92         sparc-aout      sparc-vxworks   sparclite-aout 
93 CC = cc -Xs
94 GCC = gcc -O -pipe
95 all: all-cygnus
96 endif
97
98 ifeq ($(canonhost),mips-dec-ultrix)
99 TARGETS = $(NATIVE) m68k-aout
100 CC = cc -Wf,-XNg1000
101 all: all-cygnus
102 endif
103
104 ifeq ($(canonhost),mips-sgi-irix4)
105 TARGETS = $(NATIVE) sh-hms
106 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1500
107 all: all-cygnus
108 endif
109
110 ifeq ($(canonhost),rs6000-ibm-aix)
111 TARGETS = $(NATIVE) \
112         i960-vxworks    i960-intel-nindy \
113         m68k-aout       m68k-vxworks 
114 all: all-cygnus
115 endif
116
117 ifeq ($(canonhost),m68k-hp-hpux)
118 TARGETS = $(NATIVE) 
119 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
120 CC = cc -Wp,-P 
121 #CFLAGS = +O1000 
122 CFLAGS = -g
123 all: all-cygnus
124 endif
125
126 ifeq ($(canonhost),hppa1.1-hp-hpux)
127 TARGETS = \
128         i960-vxworks \
129         m68k-aout       m68k-vxworks
130 #       a29k-amd-udi    \
131 #       h8300-hms       h8500-hms \
132 #       i386-aout       i386-go32 \
133 #       i960-vxworks    i960-intel-nindy \
134 #       mips-idt-ecoff  \
135 #       m68k-aout       m68k-vxworks    m68k-coff \
136 #       m88k-coff \
137 #       sparc-aout      sparclite-aout \
138 #       z8k-sim         
139 CC = cc 
140 #CFLAGS = +Obb2000
141 CFLAGS = -g
142 all: all-native
143 endif
144
145 ifeq ($(canonhost),i386-sco3.2v4)
146 TARGETS = $(NATIVE) i386-aout
147 all: all-cygnus
148 endif
149
150 ifeq ($(canonhost),i386-go32)
151 TARGETS = \
152         a29k-amd-udi \
153         h8300-hms \
154         i386-aout \
155         m68k-aout       m68k-coff \
156         mips-idt-ecoff \
157         sparclite-aout
158 CC = i386-go32-gcc
159 GCC = i386-go32-gcc -O
160 CFLAGS =
161 CXXFLAGS = -O
162 MAKEINFOFLAGS = --no-split
163 all: all-cross
164 endif
165
166 ifeq ($(canonhost),i386-univel-sysv4)
167 TARGETS = $(NATIVE) 
168 CC = cc
169 all: all-cygnus
170 endif
171
172 ifeq ($(canonhost),i386-lynxos)
173 TARGETS = $(NATIVE)
174 CC = /bin/gcc
175 all: all-cygnus
176 endif
177
178 ifeq ($(canonhost),m68k-lynxos)
179 TARGETS = $(NATIVE)
180 CC = /bin/gcc
181 all: all-cygnus
182 endif
183
184
185 FLAGS_TO_PASS := \
186         "GCC=$(GCC)" \
187         "CC=$(CC)" \
188         "CFLAGS=$(CFLAGS)" \
189         "CXXFLAGS=$(CXXFLAGS)" \
190         "host=$(canonhost)" \
191         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
192         "RELEASE_TAG=$(RELEASE_TAG)"
193
194 all-emacs:
195         @echo build started at `date`
196         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
197         -rm -f $(ROOTING)/$(RELEASE_TAG)
198         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
199         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-native-log 2>&1 
200         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-latest-log 2>&1 
201         @echo done at `date`
202
203 all-cygnus:
204         @echo build started at `date`
205         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
206         rm -f $(ROOTING)/$(RELEASE_TAG)
207         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
208         @for i in $(TARGETS) ; do \
209           if [ "$$i" = "native" ] ; then \
210             if [ ! -f $(canonhost)-stamp-3stage-done ] ; then \
211               echo "3staging $(canonhost) native" ; \
212               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
213                  echo "     completed successfully" ; \
214             else \
215               true ; \
216             fi \
217           else \
218             echo "building $(canonhost) cross to $$i" ; \
219             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
220                echo "     completed successfully" ; \
221           fi ; \
222         done
223         @echo done at `date`
224
225 native:
226         @echo build started at `date`
227         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
228         rm -f $(ROOTING)/$(RELEASE_TAG)
229         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
230         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
231         @echo done at `date`
232
233 build-cygnus:
234         @echo build started at `date`
235         @for i in $(TARGETS) ; do \
236           if [ "$$i" = "native" ] ; then \
237             if [ ! -f $(canonhost)-3stage-done ] ; then \
238               echo "3staging $(canonhost) native" ; \
239               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
240                  echo "     completed successfully" ; \
241             fi \
242           else \
243             echo "building $(canonhost) cross to $$i:" `date` ; \
244             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
245                echo "     completed successfully" ; \
246           fi ; \
247         done
248         @echo done at `date`
249
250 all-native:
251         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
252         rm -f $(ROOTING)/$(RELEASE_TAG)
253         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
254         @for i in $(TARGETS) ; do \
255             echo "building $(canonhost) cross to $$i" ; \
256             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
257                echo "     completed successfully" ; \
258         done
259
260 all-cross:
261         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
262         rm -f $(ROOTING)/$(RELEASE_TAG)
263         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
264         @for i in $(TARGETS) ; do \
265             echo "building $(canonhost) cross to $$i" ; \
266             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(tlog) && \
267                echo "     completed successfully" ; \
268         done
269
270 config:
271         @for i in $(TARGETS) ; do \
272           if [ "$$i" = "native" ] ; then \
273             echo "config stage1 for $(canonhost)" ; \
274             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
275                echo "     completed successfully" ; \
276           else \
277             echo "config $(canonhost) cross to $$i" ; \
278             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
279                echo "     completed successfully" ;  \
280           fi ; \
281         done
282
283
284 build:
285         @for i in $(TARGETS) ; do \
286           if [ "$$i" = "native" ] ; then \
287             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
288                echo "     completed successfully" ; \
289           else \
290             echo "building $(canonhost) cross to $$i" ; \
291             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
292                echo "     completed successfully" ; \
293           fi ; \
294         done
295
296
297 3build:
298         @for i in $(TARGETS) ; do \
299           if [ "$$i" = "native" ] ; then \
300             echo "building 3stage for $(canonhost)" ; \
301             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
302                echo "     completed successfully" ; \
303           else \
304             echo "building $(canonhost) cross to $$i" ; \
305             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
306                echo "     completed successfully" ; \
307           fi ; \
308         done
309
310 ### Local Variables:
311 ### fill-column: 131
312 ### End: