* build-all.mk: Use CC=cc -Xs on Solaris.
[binutils-gdb.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 ifndef host
9 error:; @echo You must set the variable \"host\" to use this Makefile ; exit 1
10 else
11
12 # the rest of the makefile
13
14 TREE = devo
15
16 NATIVE = native
17
18 DATE = 930309
19
20 TAG = latest-$(DATE)
21
22 INSTALLDIR = /build/ian/devo-test/$(TAG)
23
24 GCC = gcc -O
25 CFLAGS = -g
26
27 log = 1>$(canonhost)-build-log 2>&1
28 tlog = 1> $(canonhost)-x-$$i-build-log 2>&1
29
30 canonhost := $(shell $(TREE)/config.sub $(host))
31 ifeq ($(canonhost),i386-unknown-sco3.2v4)
32 canonhost := i386-sco3.2v4
33 endif
34
35 ifeq ($(canonhost),sparc-sun-sunos4.1.1)
36 TARGETS = $(NATIVE) m68k-aout i386-aout a29k-amd-udi \
37 i960-vxworks m68k-coff m68k-vxworks \
38 i960-intel-nindy sparc-aout sparc-vxworks \
39 sparclite-aout sparclitefrwcompat-aout
40 all: all-cygnus
41 endif
42
43 ifeq ($(canonhost),m68k-sun-sunos4.1.1)
44 TARGETS = $(NATIVE) m68k-vxworks m68k-aout i386-aout
45 GCC = gcc -O -msoft-float
46 CC = cc -J
47 all: all-cygnus
48 endif
49
50 ifeq ($(canonhost),sparc-sun-solaris2)
51 TARGETS = $(NATIVE) m68k-aout sparc-aout a29k-amd-udi
52 CC = cc -Xs
53 all: all-cygnus
54 endif
55
56 ifeq ($(canonhost),mips-dec-ultrix)
57 TARGETS = $(NATIVE) m68k-vxworks m68k-aout i960-vxworks \
58 sparc-vxworks m68k-coff i386-aout sparc-aout i960-intel-nindy
59 CC = cc -Wf,-XNg1000
60 all: all-cygnus
61 endif
62
63 ifeq ($(canonhost),mips-sgi-irix4)
64 TARGETS = $(NATIVE) m68k-vxworks a29k-amd-udi
65 CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh1100
66 all: all-cygnus
67 endif
68
69 ifeq ($(canonhost),rs6000-ibm-aix)
70 TARGETS = $(NATIVE) m68k-vxworks i960-vxworks m68k-aout
71 all: all-cygnus
72 endif
73
74 ifeq ($(canonhost),m68k-hp-hpux)
75 TARGETS = m68k-vxworks
76 TMPDIR := $(shell mkdir $(canonhost)-tmpdir; cd $(canonhost)-tmpdir ; pwd)
77 CC = cc +O1000 -Wp,-P
78 CFLAGS =
79 all: all-native
80 endif
81
82 ifeq ($(canonhost),hppa1.1-hp-hpux)
83 #TARGETS = m68k-aout m68k-coff m68k-vxworks i960-vxworks a29k-amd-udi
84 TARGETS = m68k-aout i386-aout a29k-amd-udi \
85 i960-vxworks m68k-coff m68k-vxworks \
86 sparc-aout sparc-vxworks \
87 sparclite-aout sparclitefrwcompat-aout
88 CC = cc
89 all: all-native
90 endif
91
92 ifeq ($(canonhost),i386-sco3.2v4)
93 TARGETS = $(NATIVE) i386-aout
94 all: all-cygnus
95 endif
96
97 FLAGS_TO_PASS := \
98 "GCC=$(GCC)" \
99 "CC=$(CC)" \
100 "CFLAGS=$(CFLAGS)" \
101 "host=$(canonhost)"
102
103 all-cygnus:
104 @echo build started at `date`
105 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
106 rm -f /usr/cygnus/$(TAG)
107 ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
108 @for i in $(TARGETS) ; do \
109 if [ "$$i" = "native" ] ; then \
110 if [ ! -f $(canonhost)-3stage-done ] ; then \
111 echo "3staging $(canonhost) native" ; \
112 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
113 echo " completed successfully" ; \
114 fi \
115 else \
116 echo "building $(canonhost) cross to $$i" ; \
117 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-cygnus $(tlog) && \
118 echo " completed successfully" ; \
119 fi ; \
120 done
121 @echo done at `date`
122
123 native:
124 @echo build started at `date`
125 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
126 rm -f /usr/cygnus/$(TAG)
127 ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
128 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log)
129 @echo done at `date`
130
131 build-cygnus:
132 @echo build started at `date`
133 @for i in $(TARGETS) ; do \
134 if [ "$$i" = "native" ] ; then \
135 if [ ! -f $(canonhost)-3stage-done ] ; then \
136 echo "3staging $(canonhost) native" ; \
137 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) $(canonhost)-stamp-3stage-done $(log) && \
138 echo " completed successfully" ; \
139 fi \
140 else \
141 echo "building $(canonhost) cross to $$i:" `date` ; \
142 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
143 echo " completed successfully" ; \
144 fi ; \
145 done
146 @echo done at `date`
147
148 all-native:
149 [ -d $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
150 rm -f /usr/cygnus/$(TAG)
151 ln -s $(INSTALLDIR) /usr/cygnus/$(TAG)
152 @for i in $(TARGETS) ; do \
153 echo "building $(canonhost) cross to $$i" ; \
154 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native $(tlog) && \
155 echo " completed successfully" ; \
156 done
157
158 config:
159 @for i in $(TARGETS) ; do \
160 if [ "$$i" = "native" ] ; then \
161 echo "config stage1 for $(canonhost)" ; \
162 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-config $(log) && \
163 echo " completed successfully" ; \
164 else \
165 echo "config $(canonhost) cross to $$i" ; \
166 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i do-native-config $(tlog) && \
167 echo " completed successfully" ; \
168 fi ; \
169 done
170
171
172 build:
173 @for i in $(TARGETS) ; do \
174 if [ "$$i" = "native" ] ; then \
175 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) do1-build $(log) && \
176 echo " completed successfully" ; \
177 else \
178 echo "building $(canonhost) cross to $$i" ; \
179 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-native $(tlog) && \
180 echo " completed successfully" ; \
181 fi ; \
182 done
183
184
185 3build:
186 @for i in $(TARGETS) ; do \
187 if [ "$$i" = "native" ] ; then \
188 echo "building 3stage for $(canonhost)" ; \
189 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) all $(log) && \
190 echo " completed successfully" ; \
191 else \
192 echo "building $(canonhost) cross to $$i" ; \
193 $(MAKE) -f test-build.mk $(FLAGS_TO_PASS) target=$$i build-cygnus $(tlog) && \
194 echo " completed successfully" ; \
195 fi ; \
196 done
197
198 endif # host
199
200 ### Local Variables:
201 ### fill-column: 131
202 ### End: