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