Correct all-cross target for release-info stuff.
[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 = /cirdan/abc
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
24 log     = 1>$(canonhost)-build-log 2>&1
25 tlog    = 1> $(canonhost)-x-$$i-build-log 2>&1
26
27 canonhost := $(shell $(TREE)/config.sub $(host))
28
29 # Convert config.guess results to a simpler form.
30 ifeq ($(canonhost),mips-dec-ultrix4.2)
31 canonhost := mips-dec-ultrix
32 endif
33 ifeq ($(canonhost),mips-sgi-irix4.0.1)
34 canonhost := mips-sgi-irix4
35 endif
36 ifeq ($(canonhost),rs6000-ibm-aix3.2)
37 canonhost := rs6000-ibm-aix
38 endif
39 ifeq ($(canonhost),i486-unknown-sco3.2v4.0)
40 canonhost := i386-sco3.2v4
41 endif
42 ifeq ($(canonhost),i386-unknown-go32)
43 canonhost := i386-go32
44 endif
45
46 ifeq ($(canonhost),sparc-sun-sunos4.1.1)
47 TARGETS = $(NATIVE)     i386-go32       m68k-aout       m68k-vxworks \
48         i960-intel-nindy                i386-aout       a29k-amd-udi \
49         sparc-vxworks   m68k-coff       i960-vxworks    sparc-aout \
50         sparclite-aout  sparclitefrwcompat-aout         h8300-hms \
51         z8k-sim         mips-idt-ecoff
52 all: all-cygnus
53 endif
54
55 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
56 TARGETS = $(NATIVE) m68k-aout m68k-vxworks m68k-coff
57 GCC = gcc -O -msoft-float
58 CC = cc -J
59 all: all-cygnus
60 endif
61
62 ifeq ($(canonhost),sparc-sun-solaris2)
63 TARGETS = $(NATIVE) m68k-vxworks m68k-aout sparc-aout mips-idt-ecoff
64 CC = cc -Xs
65 all: all-cygnus
66 endif
67
68 ifeq ($(canonhost),mips-dec-ultrix)
69 TARGETS = $(NATIVE) m68k-aout
70 # TARGETS       = $(NATIVE) m68k-vxworks m68k-aout i960-vxworks \
71 #         sparc-vxworks m68k-coff i386-aout sparc-aout i960-intel-nindy
72 CC = cc -Wf,-XNg1000
73 all: all-cygnus
74 endif
75
76 ifeq ($(canonhost),mips-sgi-irix4)
77 TARGETS = $(NATIVE) m68k-vxworks
78 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1500
79 all: all-cygnus
80 endif
81
82 ifeq ($(canonhost),rs6000-ibm-aix)
83 TARGETS = $(NATIVE) m68k-aout m68k-vxworks i960-vxworks
84 all: all-cygnus
85 endif
86
87 ifeq ($(canonhost),m68k-hp-hpux)
88 TARGETS = $(NATIVE) m68k-vxworks
89 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
90 CC = cc +O1000 -Wp,-P
91 CFLAGS = 
92 all: all-cygnus
93 endif
94
95 ifeq ($(canonhost),hppa1.1-hp-hpux)
96 TARGETS = i960-vxworks m68k-aout m68k-vxworks m68k-hp-hpux
97 #TARGETS        = m68k-aout m68k-coff m68k-vxworks i960-vxworks a29k-amd-udi
98 #TARGETS        = m68k-aout     i386-aout       a29k-amd-udi \
99 #         i960-vxworks  m68k-coff       m68k-vxworks \
100 #         sparc-aout                    sparc-vxworks \
101 #         sparclite-aout                sparclitefrwcompat-aout
102 CC = cc 
103 all: all-native
104 endif
105
106 ifeq ($(canonhost),i386-sco3.2v4)
107 TARGETS = $(NATIVE) i386-aout
108 all: all-cygnus
109 endif
110
111 ifeq ($(canonhost),i386-go32)
112 TARGETS = m68k-aout a29k-amd-udi m68k-coff i386-aout sparclite-aout \
113           h8300-sim mips-idt-ecoff
114 ifndef build
115 build := $(shell $(TREE)/config.guess)
116 endif
117 CC = i386-go32-gcc
118 GCC = i386-go32-gcc -O
119 all: all-cross
120 endif
121
122 FLAGS_TO_PASS := \
123         "GCC=$(GCC)" \
124         "CC=$(CC)" \
125         "CFLAGS=$(CFLAGS)" \
126         "host=$(canonhost)" \
127         "RELEASE_TAG=$(RELEASE_TAG)"
128
129 all-emacs:
130         @echo build started at `date`
131         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
132         rm -f $(ROOTING)/$(RELEASE_TAG)
133         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
134         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1 > $(canonhost)-native-log 2>&1 
135         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do-latest > $(canonhost)-latest-log 2>&1 
136         @echo done at `date`
137
138 all-cygnus:
139         @echo build started at `date`
140         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
141         rm -f $(ROOTING)/$(RELEASE_TAG)
142         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
143         @for i in $(TARGETS) ; do \
144           if [ "$$i" = "native" ] ; then \
145             if [ ! -f $(canonhost)-3stage-done ] ; then \
146               echo "3staging $(canonhost) native" ; \
147               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
148                  echo "     completed successfully" ; \
149             fi \
150           else \
151             echo "building $(canonhost) cross to $$i" ; \
152             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
153                echo "     completed successfully" ; \
154           fi ; \
155         done
156         @echo done at `date`
157
158 native:
159         @echo build started at `date`
160         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
161         rm -f $(ROOTING)/$(RELEASE_TAG)
162         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG) 
163         $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
164         @echo done at `date`
165
166 build-cygnus:
167         @echo build started at `date`
168         @for i in $(TARGETS) ; do \
169           if [ "$$i" = "native" ] ; then \
170             if [ ! -f $(canonhost)-3stage-done ] ; then \
171               echo "3staging $(canonhost) native" ; \
172               $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
173                  echo "     completed successfully" ; \
174             fi \
175           else \
176             echo "building $(canonhost) cross to $$i:" `date` ; \
177             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
178                echo "     completed successfully" ; \
179           fi ; \
180         done
181         @echo done at `date`
182
183 all-native:
184         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
185         rm -f $(ROOTING)/$(RELEASE_TAG)
186         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
187         @for i in $(TARGETS) ; do \
188             echo "building $(canonhost) cross to $$i" ; \
189             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
190                echo "     completed successfully" ; \
191         done
192
193 all-cross:
194         [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
195         rm -f $(ROOTING)/$(RELEASE_TAG)
196         ln -s $(INSTALLDIR) $(ROOTING)/$(RELEASE_TAG)
197         @for i in $(TARGETS) ; do \
198             echo "building $(canonhost) cross to $$i" ; \
199             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build=$(build) do-cygnus $(tlog) && \
200                echo "     completed successfully" ; \
201         done
202
203 config:
204         @for i in $(TARGETS) ; do \
205           if [ "$$i" = "native" ] ; then \
206             echo "config stage1 for $(canonhost)" ; \
207             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
208                echo "     completed successfully" ; \
209           else \
210             echo "config $(canonhost) cross to $$i" ; \
211             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
212                echo "     completed successfully" ;  \
213           fi ; \
214         done
215
216
217 build:
218         @for i in $(TARGETS) ; do \
219           if [ "$$i" = "native" ] ; then \
220             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
221                echo "     completed successfully" ; \
222           else \
223             echo "building $(canonhost) cross to $$i" ; \
224             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
225                echo "     completed successfully" ; \
226           fi ; \
227         done
228
229
230 3build:
231         @for i in $(TARGETS) ; do \
232           if [ "$$i" = "native" ] ; then \
233             echo "building 3stage for $(canonhost)" ; \
234             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
235                echo "     completed successfully" ; \
236           else \
237             echo "building $(canonhost) cross to $$i" ; \
238             $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
239                echo "     completed successfully" ; \
240           fi ; \
241         done
242
243 ### Local Variables:
244 ### fill-column: 131
245 ### End: