* decl.c (initialize_local_var): Handle static variables here.
[official-gcc.git] / libstdc++ / Makefile.in
blobeeff18c78601859066849980ee0a39ec430ecbd9
1 # Copyright (C) 1994, 1995, 1999 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 SUBLIBS = $(STAMP)-string $(STAMP)-complx
25 # C++ headers with no extension
26 HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
27 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
28 cwchar cwctype string stdexcept \
29 algorithm deque functional hash_map hash_set iterator list map \
30 memory numeric pthread_alloc queue rope set slist stack utility \
31 vector fstream iomanip iostream strstream iosfwd bitset valarray
33 ARLIB = libstdc++.a.$(VERSION)
34 ARLINK = libstdc++.a
35 MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
36 SHLIB = libstdc++.so.$(VERSION)
37 SHARLIB = libstdc++-sh.a
38 SHLINK = libstdc++.so
39 MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
40 SHFLAGS =
41 SHDEPS =
43 STAMP = bigstmp
45 LIBS = $(ARLIB) $(ARLINK)
47 #### package, host, target, and site dependent Makefile fragments come in here.
50 IO_DIR = ../libio
51 LIBIBERTY_DIR = ../libiberty
53 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
55 tooldir = $(exec_prefix)/$(target)
56 # This is where the libraries will be installed; note, it will be set
57 # at make runtime now. See below at target install.
58 INSTALLDIR = $(libdir)
60 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
61 CLEAN_JUNK = $(LIBS)
63 .PHONY: libs
64 libs: $(LIBS)
66 stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
67 -rm -f tlist
68 touch tlist
69 echo *.o >> tlist
70 for f in `cat $(IO_DIR)/iostream.list` ; do \
71 echo "$(IO_DIR)/$$f" >> tlist ; \
72 done
73 for f in $(LIBIBERTY_OBJS) ; do \
74 echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
75 done
76 mv tlist stdlist
78 piclist: stdlist
79 -rm -f tlist
80 cp stdlist tlist
81 if [ x"$(enable_shared)" = xyes ]; then \
82 sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
83 mv tlist2 tlist ; \
84 else true ; fi
85 mv tlist piclist
87 $(ARLIB): stdlist
88 -rm -f t$(ARLIB)
89 $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
90 mv t$(ARLIB) $(ARLIB)
91 $(RANLIB) $(ARLIB)
93 $(ARLINK):
94 -rm -f $(ARLINK)
95 $(LN_S) $(ARLIB) $(ARLINK) || cp $(ARLIB) $(ARLINK)
97 marlink:
98 @$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
100 $(SHLIB): piclist
101 $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
103 $(SHARLIB): $(SHLIB)
104 -rm -f t$(SHARLIB)
105 $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
106 mv t$(SHARLIB) $(SHARLIB)
107 $(RANLIB) $(SHARLIB)
109 $(SHLINK):
110 -rm -f $(SHLINK)
111 $(LN_S) $(SHLIB) $(SHLINK) || cp $(ARLIB) $(ARLINK)
113 mshlink:
114 @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
116 $(IO_DIR)/iostream.list: force
117 cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
119 $(LIBIBERTY_DIR)/libiberty.a:
120 cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
122 STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
123 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
124 LESS LEPS LESP GESS GEPS GESP
125 STRIO = EXTRACT INSERT GETLINE
127 # These are here for SunOS VPATH.
128 cstringi.o: cstringi.cc
129 cstdlibi.o: cstdlibi.cc
130 cmathi.o: cmathi.cc
131 stdexcepti.o: stdexcepti.cc
132 stlinst.o: stlinst.cc
133 valarray.o: valarray.cc
135 # Later do wide strings, too.
136 stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
137 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
138 for name in $(STRFUNCS) $(STRIO); do \
139 echo c$${name}; \
140 if [ x"$(enable_shared)" = xyes ]; then \
141 $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
142 -o pic/c$${name}.o; \
143 else true ; fi; \
144 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
145 $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
146 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
147 done
148 touch stmp-string
150 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
151 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
152 echo cstring
153 if [ x"$(enable_shared)" = xyes ]; then \
154 $(COMPILE.cc) $(PICFLAG) -DC \
155 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
156 $(srcdir)/sinst.cc -o pic/cstrmain.o; \
157 else true ; fi
158 $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
159 $(srcdir)/sinst.cc -o cstrmain.o
160 echo cstrio
161 if [ x"$(enable_shared)" = xyes ]; then \
162 $(COMPILE.cc) $(PICFLAG) -DC \
163 `for N in $(STRIO); do echo " -D$${N}"; done` \
164 $(srcdir)/sinst.cc -o pic/cstrio.o; \
165 else true ; fi
166 $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
167 $(srcdir)/sinst.cc -o cstrio.o
168 touch bigstmp-string
170 COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
171 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
172 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
173 COMIO = EXTRACT INSERT
175 stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
176 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
177 ${srcdir}/std/ldcomplex.h
178 for N in $(COMFUNCS) $(COMIO); do \
179 echo f$${N}; \
180 if [ x"$(enable_shared)" = xyes ]; then \
181 $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
182 -o pic/f$${N}.o; \
183 else true ; fi; \
184 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
185 $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
186 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
187 echo d$${N}; \
188 if [ x"$(enable_shared)" = xyes ]; then \
189 $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
190 -o pic/d$${N}.o; \
191 else true ; fi; \
192 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
193 $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
194 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
195 echo ld$${N}; \
196 if [ x"$(enable_shared)" = xyes ]; then \
197 $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
198 -o pic/ld$${N}.o; \
199 else true ; fi; \
200 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
201 $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
202 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
203 done
204 touch stmp-complx
206 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
207 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
208 ${srcdir}/std/ldcomplex.h
209 echo fcomplex
210 if [ x"$(enable_shared)" = xyes ]; then \
211 $(COMPILE.cc) $(PICFLAG) -DF \
212 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
213 $(srcdir)/cinst.cc -o pic/fcomplex.o; \
214 else true ; fi
215 $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
216 $(srcdir)/cinst.cc -o fcomplex.o
217 echo fcomio
218 if [ x"$(enable_shared)" = xyes ]; then \
219 $(COMPILE.cc) $(PICFLAG) -DF \
220 `for N in $(COMIO); do echo " -D$${N}"; done` \
221 $(srcdir)/cinst.cc -o pic/fcomio.o; \
222 else true ; fi
223 $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
224 $(srcdir)/cinst.cc -o fcomio.o
225 echo dcomplex
226 if [ x"$(enable_shared)" = xyes ]; then \
227 $(COMPILE.cc) $(PICFLAG) -DD \
228 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
229 $(srcdir)/cinst.cc -o pic/dcomplex.o; \
230 else true ; fi
231 $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
232 $(srcdir)/cinst.cc -o dcomplex.o
233 echo dcomio
234 if [ x"$(enable_shared)" = xyes ]; then \
235 $(COMPILE.cc) $(PICFLAG) -DD \
236 `for N in $(COMIO); do echo " -D$${N}"; done` \
237 $(srcdir)/cinst.cc -o pic/dcomio.o; \
238 else true ; fi
239 $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
240 $(srcdir)/cinst.cc -o dcomio.o
241 echo ldcomplex
242 if [ x"$(enable_shared)" = xyes ]; then \
243 $(COMPILE.cc) $(PICFLAG) -DLD \
244 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
245 $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
246 else true ; fi
247 $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
248 $(srcdir)/cinst.cc -o ldcomplex.o
249 echo ldcomio
250 if [ x"$(enable_shared)" = xyes ]; then \
251 $(COMPILE.cc) $(PICFLAG) -DLD \
252 `for N in $(COMIO); do echo " -D$${N}"; done` \
253 $(srcdir)/cinst.cc -o pic/ldcomio.o; \
254 else true ; fi
255 $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
256 $(srcdir)/cinst.cc -o ldcomio.o
257 touch bigstmp-complx
259 .PHONY: install
260 install:
261 rootme=`pwd`/ ; export rootme ; \
262 if [ -z "$(MULTISUBDIR)" ]; then \
263 cd $(srcdir); \
264 for FILE in $(HEADERS); do \
265 rm -f $(gxx_include_dir)/$$FILE ; \
266 if [ -f stl/$$FILE ]; then \
267 $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
268 else \
269 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
270 fi ; \
271 chmod a-x $(gxx_include_dir)/$$FILE ; \
272 done ; \
273 for FILE in *.h std/*.h std/*.cc std/*.tcc; do \
274 rm -f $(gxx_include_dir)/$$FILE ; \
275 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
276 chmod a-x $(gxx_include_dir)/$$FILE ; \
277 done ; \
278 cd stl; \
279 for FILE in *.h; do \
280 rm -f $(gxx_include_dir)/$$FILE ; \
281 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
282 chmod a-x $(gxx_include_dir)/$$FILE ; \
283 done ; \
284 else true ; \
286 rootme=`pwd`/ ; export rootme ; \
287 if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
288 INSTALLDIR=$(libdir); \
289 else \
290 INSTALLDIR=$(libsubdir); \
291 fi; \
292 INSTALLLINKDIR=$(libsubdir); \
293 if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
294 RELINSTALLDIR=; \
295 elif [ x$(MULTISUBDIR) = x ]; then \
296 if [ $(build_alias) = $(target_alias) ]; then \
297 RELINSTALLDIR=../../../; \
298 else \
299 RELINSTALLDIR=../../../../$(target_alias)/lib/; \
300 fi; \
301 else \
302 if [ $(build_alias) = $(target_alias) ]; then \
303 RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
304 else \
305 RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
306 fi; \
307 fi; \
308 if [ $(build_alias) != $(target_alias) ]; then \
309 case $$RELINSTALLDIR in \
310 ../../../|../../../../) \
311 RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
312 esac; \
313 fi; \
314 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
315 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
316 for FILE in $(LIBS) ; do \
317 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
318 if [ $$FILE = $(SHLINK) ] ; then \
319 if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
320 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
321 $(LN_S) $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
322 || cp $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
323 else \
324 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
325 $(LN_S) $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
326 || cp $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
327 fi; \
328 elif [ $$FILE = $(ARLINK) ] ; then \
329 if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
330 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
331 $(LN_S) $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
332 || cp $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
333 else \
334 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
335 $(LN_S) $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
336 || cp $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
337 fi; \
338 elif [ $$FILE = mshlink ]; then \
339 for FILE in $(MSHLINK) ; do \
340 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
341 $(LN_S) $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
342 || cp $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
343 done; \
344 elif [ $$FILE = marlink ]; then \
345 for FILE in $(MARLINK) ; do \
346 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
347 $(LN_S) $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
348 || cp $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
349 done; \
350 elif [ $$FILE = $(SHLIB) ]; then \
351 $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
352 : On the HP, shared libraries must be mode 555. ;\
353 chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
354 else \
355 $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
356 $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
357 chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
358 fi ; \
359 done
360 @rootme=`pwd`/ ; export rootme ; \
361 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
363 .PHONY: force
364 force:
366 MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long
367 MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
369 .PHONY: stuff
370 stuff:
371 $(MAKE) stuff1
372 $(MAKE) stuff2
374 stuff1:
375 $(MAKE) clean
376 $(MAKE) -C ../libio c++clean
377 touch ../../gcc/libgcc2.ready
379 stuff2:
380 $(MAKE) -C ../../gcc/ libgcc.a
381 $(MAKE) CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
382 -$(MAKE) check
383 -$(MAKE) -C ../libio check
384 -$(MAKE) -C ../../gcc check-g++