update for datasheet
[platform/upstream/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       \
74         i386-aout       \
75         i386-lynx       \
76         i386-netware    \
77         i960-vxworks    i960-intel-nindy \
78         mips-idt-ecoff  \
79         m68k-aout       m68k-vxworks    m68k-coff \
80         m68k-lynx       \
81         sh-hms          \
82         sparc-aout      sparc-vxworks   \
83         sparclite-aout  sparclite-vxworks \
84         z8k-coff
85 GCC = gcc -O -pipe
86 all: all-cygnus
87 endif
88
89 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
90 TARGETS = $(NATIVE) \
91         m68k-aout       m68k-coff       i960-intel-nindy 
92 GCC = gcc -O -msoft-float
93 CC = cc -J
94 all: all-cygnus
95 endif
96
97 ifeq ($(canonhost),sparc-sun-solaris2)
98 TARGETS = $(NATIVE) \
99         a29k-amd-udi \
100         i386-aout \
101         i960-vxworks    i960-intel-nindy \
102         m68k-aout       m68k-coff       m68k-vxworks \
103         m88k-coff       \
104         mips-idt-ecoff  mipsel-idt-ecoff \
105         sparc-aout      sparc-vxworks   sparclite-aout
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         i960-vxworks    i960-intel-nindy \
127         m68k-vxworks
128 all: all-cygnus
129 endif
130
131 ifeq ($(canonhost),m68k-hp-hpux)
132 TARGETS = $(NATIVE)     m68k-aout
133 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
134 CC = cc -Wp,-P 
135 #CFLAGS = +O1000 
136 CFLAGS = 
137 all: all-cygnus
138 endif
139
140 ifeq ($(canonhost),hppa1.1-hp-hpux)
141 TARGETS = \
142         $(NATIVE) \
143         i960-vxworks \
144         m68k-aout       m68k-vxworks
145 #       sh-hms          # doesn't work
146 CC = cc 
147 #CFLAGS = +Obb2000
148 CFLAGS = -g
149 all: all-native
150 endif
151
152 ifeq ($(canonhost),i386-sco3.2v4)
153 TARGETS = $(NATIVE) i386-aout
154 all: all-cygnus
155 endif
156
157 ifeq ($(canonhost),i386-go32)
158 TARGETS = \
159         a29k-amd-udi \
160         h8300-hms       \
161         i386-aout       \
162         m68k-aout       m68k-coff \
163         mips-idt-ecoff  \
164         sh-hms          \
165         sparclite-aout
166 CC = i386-go32-gcc
167 GCC = i386-go32-gcc -O
168 CFLAGS =
169 CXXFLAGS = -O
170 MAKEINFOFLAGS = --no-split
171 all: all-cross
172 endif
173
174 ifeq ($(canonhost),i386-sysv4.2)
175 TARGETS = $(NATIVE) 
176 CC = cc
177 all: all-cygnus
178 endif
179
180 ifeq ($(canonhost),i386-lynxos)
181 TARGETS = $(NATIVE)
182 CC = /bin/gcc
183 all: all-cygnus
184 endif
185
186 ifeq ($(canonhost),m68k-lynxos)
187 TARGETS = $(NATIVE)
188 CC = /bin/gcc
189 all: all-cygnus
190 endif
191
192
193 FLAGS_TO_PASS := \
194         "GCC=$(GCC)" \
195         "CC=$(CC)" \
196         "CFLAGS=$(CFLAGS)" \
197         "CXXFLAGS=$(CXXFLAGS)" \
198         "host=$(canonhost)" \
199         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
200         "RELEASE_TAG=$(RELEASE_TAG)"
201
202 all-emacs:
203         @echo build started at `date`
204         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
205         -rm -f $(ROOTING)/$(RELEASE_TAG)
206         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
207         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-emacs-native-log 2>&1 
208         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-emacs-latest-log 2>&1 
209         @echo done at `date`
210
211 all-cygnus:
212         @echo build started at `date`
213         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
214         -rm -f $(ROOTING)/$(RELEASE_TAG) && ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
215         @for i in $(TARGETS) ; do \
216           if [ "$$i" = "native" ] ; then \
217             if [ ! -f $(canonhost)-stamp-3stage-done ] ; then \
218               echo "3staging $(canonhost) native" ; \
219               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
220                  echo "     completed successfully" ; \
221             else \
222               true ; \
223             fi \
224           else \
225             echo "building $(canonhost) cross to $$i" ; \
226             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(cyglog) && \
227                echo "     completed successfully" ; \
228           fi ; \
229         done
230         @if [ ! -f $(canonhost)-stamp-3stage-checked ] ; then \
231           echo checking $(canonhost) native ; \
232           $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-check-3stage $(clog) ; \
233           touch $(canonhost)-stamp-3stage-checked ; \
234         else \
235           true ; \
236         fi
237         @echo done at `date`
238
239 native:
240         @echo build started at `date`
241         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
242         rm -f $(ROOTING)/$(RELEASE_TAG)
243         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
244         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
245         @echo done at `date`
246
247 build-cygnus:
248         @echo build started at `date`
249         @for i in $(TARGETS) ; do \
250           if [ "$$i" = "native" ] ; then \
251             if [ ! -f $(canonhost)-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             fi \
256           else \
257             echo "building $(canonhost) cross to $$i:" `date` ; \
258             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
259                echo "     completed successfully" ; \
260           fi ; \
261         done
262         @echo done at `date`
263
264 build-latest:
265         @echo build started at `date`
266         @for i in $(TARGETS) ; do \
267           if [ "$$i" != "native" ] ; then \
268             echo "building $(canonhost) cross to $$i:" `date` ; \
269             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(latestlog) && \
270                echo "     completed successfully" ; \
271           fi ; \
272         done
273         @echo done at `date`
274
275 all-native:
276         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
277         rm -f $(ROOTING)/$(RELEASE_TAG)
278         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
279         @for i in $(TARGETS) ; do \
280             echo "building $(canonhost) cross to $$i" ; \
281             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(natlog) && \
282                echo "     completed successfully" ; \
283         done
284
285 all-cross:
286         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
287         rm -f $(ROOTING)/$(RELEASE_TAG)
288         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
289         @for i in $(TARGETS) ; do \
290             echo "building $(canonhost) cross to $$i" ; \
291             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(cyglog) && \
292                echo "     completed successfully" ; \
293         done
294
295 config:
296         @for i in $(TARGETS) ; do \
297           if [ "$$i" = "native" ] ; then \
298             echo "config stage1 for $(canonhost)" ; \
299             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
300                echo "     completed successfully" ; \
301           else \
302             echo "config $(canonhost) cross to $$i" ; \
303             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(cyglog) && \
304                echo "     completed successfully" ;  \
305           fi ; \
306         done
307
308
309 build:
310         @for i in $(TARGETS) ; do \
311           if [ "$$i" = "native" ] ; then \
312             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
313                echo "     completed successfully" ; \
314           else \
315             echo "building $(canonhost) cross to $$i" ; \
316             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(natlog) && \
317                echo "     completed successfully" ; \
318           fi ; \
319         done
320
321
322 3build:
323         @for i in $(TARGETS) ; do \
324           if [ "$$i" = "native" ] ; then \
325             echo "building 3stage for $(canonhost)" ; \
326             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
327                echo "     completed successfully" ; \
328           else \
329             echo "building $(canonhost) cross to $$i" ; \
330             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(cyglog) && \
331                echo "     completed successfully" ; \
332           fi ; \
333         done
334
335 build-all-latest:
336         @for i in $(TARGETS) ; do \
337           if [ "$$i" = "native" ] ; then \
338             echo "building 3stage for $(canonhost)" ; \
339             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
340                echo "     completed successfully" ; \
341           else \
342             echo "building $(canonhost) cross to $$i" ; \
343             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-latest $(cyglog) && \
344                echo "     completed successfully" ; \
345           fi ; \
346         done
347
348 ### Local Variables:
349 ### fill-column: 131
350 ### End: