SWitch use if {save|restore}_machine_status with {init|free}_machine_status
[official-gcc.git] / libstdc++ / Makefile.in
blobfa6fe0081087c7e022c6c9626c0e1877519e2252
1 # Copyright (C) 1994, 1995, 1999, 2000 Free Software Foundation
3 # This file is part of the GNU ANSI C++ Library. This library is free
4 # software; you can redistribute it and/or modify it under the terms of
5 # the GNU General Public License as published by the Free Software
6 # Foundation; either version 2, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this library; see the file COPYING. If not, write to the Free
15 # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 VERSION = 2.10.0
18 INTERFACE = 3
20 gxx_include_dir=${includedir}/g++
22 OBJS = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o valarray.o \
23 del_op.o del_opnt.o del_opv.o del_opvnt.o exception.o new_handler.o \
24 new_op.o new_opnt.o new_opv.o new_opvnt.o tinfo.o tinfo2.o vec.o \
25 pure.o
27 SUBLIBS = $(STAMP)-string $(STAMP)-complx
29 # C++ headers with no extension
30 HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
31 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
32 cwchar cwctype string stdexcept \
33 algorithm deque functional hash_map hash_set iterator list map \
34 memory numeric pthread_alloc queue rope set slist stack utility \
35 vector fstream iomanip iostream strstream iosfwd bitset valarray \
36 sstream exception new typeinfo
38 ARLIB = libstdc++.a.$(VERSION)
39 ARLINK = libstdc++.a
40 MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
41 SHLIB = libstdc++.so.$(VERSION)
42 SHARLIB = libstdc++-sh.a
43 SHLINK = libstdc++.so
44 MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
45 SHFLAGS =
46 SHDEPS =
47 SHOPT = -shared
49 STAMP = bigstmp
51 LIBS = $(ARLIB) $(ARLINK)
53 #### package, host, target, and site dependent Makefile fragments come in here.
56 IO_DIR = ../libio
57 LIBIBERTY_DIR = ../libiberty
59 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
61 tooldir = $(exec_prefix)/$(target)
62 # This is where the libraries will be installed; note, it will be set
63 # at make runtime now. See below at target install.
64 INSTALLDIR = $(libdir)
66 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
67 CLEAN_JUNK = $(LIBS)
69 .PHONY: libs
70 libs: $(LIBS)
72 # The "pic" subdir must be created before we can put any object
73 # files into it.
74 $(OBJS): stamp-picdir
76 stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
77 -rm -f tlist
78 touch tlist
79 echo *.o >> tlist
80 for f in `cat $(IO_DIR)/iostream.list` ; do \
81 echo "$(IO_DIR)/$$f" >> tlist ; \
82 done
83 for f in $(LIBIBERTY_OBJS) ; do \
84 echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
85 done
86 mv tlist stdlist
88 piclist: stdlist
89 -rm -f tlist
90 cp stdlist tlist
91 if [ x"$(PICFLAG)" != x ]; then \
92 sed 's,\([A-Za-z_0-9]*\.o\),pic/\1,g' tlist > tlist2 ; \
93 mv tlist2 tlist ; \
94 else true ; fi
95 mv tlist piclist
97 $(ARLIB): stdlist
98 -rm -f t$(ARLIB)
99 $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
100 mv t$(ARLIB) $(ARLIB)
101 $(RANLIB) $(ARLIB)
103 $(ARLINK):
104 -rm -f $(ARLINK)
105 $(LN_S) $(ARLIB) $(ARLINK) || cp $(ARLIB) $(ARLINK)
107 marlink:
108 @$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
110 $(SHLIB): piclist
111 $(CC) $(LIBCXXFLAGS) $(SHFLAGS) $(SHOPT) -o $(SHLIB) `cat piclist` $(SHDEPS)
113 $(SHARLIB): $(SHLIB)
114 -rm -f t$(SHARLIB)
115 $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
116 mv t$(SHARLIB) $(SHARLIB)
117 $(RANLIB) $(SHARLIB)
119 $(SHLINK):
120 -rm -f $(SHLINK)
121 $(LN_S) $(SHLIB) $(SHLINK) || cp $(ARLIB) $(ARLINK)
123 mshlink:
124 @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
126 $(IO_DIR)/iostream.list: force
127 cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
129 $(LIBIBERTY_DIR)/libiberty.a:
130 cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
132 STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
133 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
134 LESS LEPS LESP GESS GEPS GESP
135 STRIO = EXTRACT INSERT GETLINE
137 # These are here for SunOS VPATH.
138 cinst.o: cinst.cc
139 cmathi.o: cmathi.cc
140 cstdlibi.o: cstdlibi.cc
141 cstringi.o: cstringi.cc
142 del_op.o: del_op.cc new
143 del_opnt.o: del_opnt.cc new
144 del_opv.o: del_opv.cc new
145 del_opvnt.o: del_opvnt.cc new
146 exception.o: exception.cc typeinfo $(srcdir)/../gcc/gansidecl.h \
147 $(srcdir)/../include/ansidecl.h $(srcdir)/../gcc/eh-common.h
148 new_handler.o: new_handler.cc new
149 new_op.o: new_op.cc new
150 new_opnt.o: new_opnt.cc new
151 new_opv.o: new_opv.cc new
152 new_opvnt.o: new_opvnt.cc new
153 sinst.o: sinst.cc
154 stdexcepti.o: stdexcepti.cc
155 stlinst.o: stlinst.cc
156 tinfo.o: tinfo.cc tinfo.hP typeinfo new
157 tinfo2.o: tinfo2.cc tinfo.hP typeinfo new
158 valarray.o: valarray.cc
159 vec.o: vec.cc
160 pure.o: pure.c
162 # Later do wide strings, too.
163 stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
164 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
165 for name in $(STRFUNCS) $(STRIO); do \
166 echo c$${name}; \
167 if [ x"$(PICFLAG)" != x ]; then \
168 $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
169 -o pic/c$${name}.o; \
170 else true ; fi; \
171 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
172 $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
173 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
174 done
175 touch stmp-string
177 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
178 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
179 echo cstring
180 if [ x"$(PICFLAG)" != x ]; then \
181 $(COMPILE.cc) $(PICFLAG) -DC \
182 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
183 $(srcdir)/sinst.cc -o pic/cstrmain.o; \
184 else true ; fi
185 $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
186 $(srcdir)/sinst.cc -o cstrmain.o
187 echo cstrio
188 if [ x"$(PICFLAG)" != x ]; then \
189 $(COMPILE.cc) $(PICFLAG) -DC \
190 `for N in $(STRIO); do echo " -D$${N}"; done` \
191 $(srcdir)/sinst.cc -o pic/cstrio.o; \
192 else true ; fi
193 $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
194 $(srcdir)/sinst.cc -o cstrio.o
195 touch bigstmp-string
197 COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
198 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
199 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
200 COMIO = EXTRACT INSERT
202 stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
203 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
204 ${srcdir}/std/ldcomplex.h
205 for N in $(COMFUNCS) $(COMIO); do \
206 echo f$${N}; \
207 if [ x"$(PICFLAG)" != x ]; then \
208 $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
209 -o pic/f$${N}.o; \
210 else true ; fi; \
211 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
212 $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
213 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
214 echo d$${N}; \
215 if [ x"$(PICFLAG)" != x ]; then \
216 $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
217 -o pic/d$${N}.o; \
218 else true ; fi; \
219 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
220 $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
221 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
222 echo ld$${N}; \
223 if [ x"$(PICFLAG)" != x ]; then \
224 $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
225 -o pic/ld$${N}.o; \
226 else true ; fi; \
227 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
228 $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
229 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
230 done
231 touch stmp-complx
233 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
234 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
235 ${srcdir}/std/ldcomplex.h
236 echo fcomplex
237 if [ x"$(PICFLAG)" != x ]; then \
238 $(COMPILE.cc) $(PICFLAG) -DF \
239 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
240 $(srcdir)/cinst.cc -o pic/fcomplex.o; \
241 else true ; fi
242 $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
243 $(srcdir)/cinst.cc -o fcomplex.o
244 echo fcomio
245 if [ x"$(PICFLAG)" != x ]; then \
246 $(COMPILE.cc) $(PICFLAG) -DF \
247 `for N in $(COMIO); do echo " -D$${N}"; done` \
248 $(srcdir)/cinst.cc -o pic/fcomio.o; \
249 else true ; fi
250 $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
251 $(srcdir)/cinst.cc -o fcomio.o
252 echo dcomplex
253 if [ x"$(PICFLAG)" != x ]; then \
254 $(COMPILE.cc) $(PICFLAG) -DD \
255 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
256 $(srcdir)/cinst.cc -o pic/dcomplex.o; \
257 else true ; fi
258 $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
259 $(srcdir)/cinst.cc -o dcomplex.o
260 echo dcomio
261 if [ x"$(PICFLAG)" != x ]; then \
262 $(COMPILE.cc) $(PICFLAG) -DD \
263 `for N in $(COMIO); do echo " -D$${N}"; done` \
264 $(srcdir)/cinst.cc -o pic/dcomio.o; \
265 else true ; fi
266 $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
267 $(srcdir)/cinst.cc -o dcomio.o
268 echo ldcomplex
269 if [ x"$(PICFLAG)" != x ]; then \
270 $(COMPILE.cc) $(PICFLAG) -DLD \
271 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
272 $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
273 else true ; fi
274 $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
275 $(srcdir)/cinst.cc -o ldcomplex.o
276 echo ldcomio
277 if [ x"$(PICFLAG)" != x ]; then \
278 $(COMPILE.cc) $(PICFLAG) -DLD \
279 `for N in $(COMIO); do echo " -D$${N}"; done` \
280 $(srcdir)/cinst.cc -o pic/ldcomio.o; \
281 else true ; fi
282 $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
283 $(srcdir)/cinst.cc -o ldcomio.o
284 touch bigstmp-complx
286 .PHONY: install
287 install:
288 rootme=`pwd`/ ; export rootme ; \
289 if [ -z "$(MULTISUBDIR)" ]; then \
290 cd $(srcdir); \
291 for FILE in $(HEADERS); do \
292 rm -f $(gxx_include_dir)/$$FILE ; \
293 if [ -f stl/$$FILE ]; then \
294 $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
295 else \
296 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
297 fi ; \
298 chmod a-x $(gxx_include_dir)/$$FILE ; \
299 done ; \
300 for FILE in *.h std/*.h std/*.cc std/*.tcc; do \
301 rm -f $(gxx_include_dir)/$$FILE ; \
302 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
303 chmod a-x $(gxx_include_dir)/$$FILE ; \
304 done ; \
305 cd stl; \
306 for FILE in *.h; do \
307 rm -f $(gxx_include_dir)/$$FILE ; \
308 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
309 chmod a-x $(gxx_include_dir)/$$FILE ; \
310 done ; \
311 else true ; \
313 rootme=`pwd`/ ; export rootme ; \
314 if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
315 INSTALLDIR=$(libdir); \
316 else \
317 INSTALLDIR=$(libsubdir); \
318 fi; \
319 INSTALLLINKDIR=$(libsubdir); \
320 if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
321 RELINSTALLDIR=; \
322 elif [ x$(MULTISUBDIR) = x ]; then \
323 if [ $(build_alias) = $(target_alias) ]; then \
324 RELINSTALLDIR=../../../; \
325 else \
326 RELINSTALLDIR=../../../../$(target_alias)/lib/; \
327 fi; \
328 else \
329 if [ $(build_alias) = $(target_alias) ]; then \
330 RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
331 else \
332 RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
333 fi; \
334 fi; \
335 if [ $(build_alias) != $(target_alias) ]; then \
336 case $$RELINSTALLDIR in \
337 ../../../|../../../../) \
338 RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
339 esac; \
340 fi; \
341 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
342 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
343 for FILE in $(LIBS) ; do \
344 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
345 if [ $$FILE = $(SHLINK) ] ; then \
346 if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
347 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
348 $(LN_S) $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
349 || cp $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
350 else \
351 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
352 $(LN_S) $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
353 || cp $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
354 fi; \
355 elif [ $$FILE = $(ARLINK) ] ; then \
356 if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
357 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
358 $(LN_S) $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
359 || cp $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
360 else \
361 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
362 $(LN_S) $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
363 || cp $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
364 fi; \
365 elif [ $$FILE = mshlink ]; then \
366 for FILE in $(MSHLINK) ; do \
367 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
368 $(LN_S) $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
369 || cp $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
370 done; \
371 elif [ $$FILE = marlink ]; then \
372 for FILE in $(MARLINK) ; do \
373 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
374 $(LN_S) $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
375 || cp $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
376 done; \
377 elif [ $$FILE = $(SHLIB) ]; then \
378 $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
379 : On the HP, shared libraries must be mode 555. ;\
380 chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
381 else \
382 $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
383 $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
384 chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
385 fi ; \
386 done
387 @rootme=`pwd`/ ; export rootme ; \
388 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
390 .PHONY: force
391 force:
393 MYCXXFLAGS = $(CXXFLAGS) -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long
394 MYCFLAGS = $(CFLAGS) -g -O2 -Wpointer-arith -Wnested-externs
396 .PHONY: stuff
397 stuff:
398 $(MAKE) stuff1
399 $(MAKE) stuff2
401 stuff1:
402 $(MAKE) clean
403 $(MAKE) -C ../libio c++clean
404 rm -f ../../gcc/cplib2.txt
406 stuff2:
407 $(MAKE) -C ../../gcc/ LANGUAGES='c c++' libgcc.a
408 $(MAKE) CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
409 -$(MAKE) check
410 -$(MAKE) -C ../libio check
411 -$(MAKE) -C ../../gcc check-g++