* stl_config.h (__CYGWIN__): Cygwin newlib RTL lacks drand48.
[gcc.git] / libstdc++ / Makefile.in
1 # Copyright (C) 1994, 1995 Free Software Foundation
2
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.
7
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.
12
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.
16
17 VERSION = 2.9.0
18 INTERFACE = 2
19
20 gxx_include_dir=${includedir}/g++
21
22 OBJS = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o
23 SUBLIBS = $(STAMP)-string $(STAMP)-complx
24
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
32
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 =
42
43 STAMP = bigstmp
44
45 LIBS = $(ARLIB) $(ARLINK)
46
47 #### package, host, target, and site dependent Makefile fragments come in here.
48 ##
49
50 IO_DIR = ../libio
51 LIBIBERTY_DIR = ../libiberty
52
53 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
54
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)
59
60 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
61 CLEAN_JUNK = $(LIBS)
62
63 .PHONY: libs
64 libs: $(LIBS)
65
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
77
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
86
87 $(ARLIB): stdlist
88 -rm -f t$(ARLIB)
89 $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
90 mv t$(ARLIB) $(ARLIB)
91 $(RANLIB) $(ARLIB)
92
93 $(ARLINK):
94 -rm -f $(ARLINK)
95 $(LN_S) $(ARLIB) $(ARLINK) || cp $(ARLIB) $(ARLINK)
96
97 marlink:
98 @$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
99
100 $(SHLIB): piclist
101 $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
102
103 $(SHARLIB): $(SHLIB)
104 -rm -f t$(SHARLIB)
105 $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
106 mv t$(SHARLIB) $(SHARLIB)
107 $(RANLIB) $(SHARLIB)
108
109 $(SHLINK):
110 -rm -f $(SHLINK)
111 $(LN_S) $(SHLIB) $(SHLINK) || cp $(ARLIB) $(ARLINK)
112
113 mshlink:
114 @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
115
116 $(IO_DIR)/iostream.list: force
117 cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
118
119 $(LIBIBERTY_DIR)/libiberty.a:
120 cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
121
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
126
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
134 # Later do wide strings, too.
135 stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
136 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
137 for name in $(STRFUNCS) $(STRIO); do \
138 echo c$${name}; \
139 if [ x"$(enable_shared)" = xyes ]; then \
140 $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
141 -o pic/c$${name}.o; \
142 else true ; fi; \
143 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
144 $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
145 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
146 done
147 touch stmp-string
148
149 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
150 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
151 echo cstring
152 if [ x"$(enable_shared)" = xyes ]; then \
153 $(COMPILE.cc) $(PICFLAG) -DC \
154 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
155 $(srcdir)/sinst.cc -o pic/cstrmain.o; \
156 else true ; fi
157 $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
158 $(srcdir)/sinst.cc -o cstrmain.o
159 echo cstrio
160 if [ x"$(enable_shared)" = xyes ]; then \
161 $(COMPILE.cc) $(PICFLAG) -DC \
162 `for N in $(STRIO); do echo " -D$${N}"; done` \
163 $(srcdir)/sinst.cc -o pic/cstrio.o; \
164 else true ; fi
165 $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
166 $(srcdir)/sinst.cc -o cstrio.o
167 touch bigstmp-string
168
169 COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
170 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
171 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
172 COMIO = EXTRACT INSERT
173
174 stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
175 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
176 ${srcdir}/std/ldcomplex.h
177 for N in $(COMFUNCS) $(COMIO); do \
178 echo f$${N}; \
179 if [ x"$(enable_shared)" = xyes ]; then \
180 $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
181 -o pic/f$${N}.o; \
182 else true ; fi; \
183 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
184 $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
185 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
186 echo d$${N}; \
187 if [ x"$(enable_shared)" = xyes ]; then \
188 $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
189 -o pic/d$${N}.o; \
190 else true ; fi; \
191 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
192 $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
193 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
194 echo ld$${N}; \
195 if [ x"$(enable_shared)" = xyes ]; then \
196 $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
197 -o pic/ld$${N}.o; \
198 else true ; fi; \
199 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
200 $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
201 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
202 done
203 touch stmp-complx
204
205 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
206 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
207 ${srcdir}/std/ldcomplex.h
208 echo fcomplex
209 if [ x"$(enable_shared)" = xyes ]; then \
210 $(COMPILE.cc) $(PICFLAG) -DF \
211 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
212 $(srcdir)/cinst.cc -o pic/fcomplex.o; \
213 else true ; fi
214 $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
215 $(srcdir)/cinst.cc -o fcomplex.o
216 echo fcomio
217 if [ x"$(enable_shared)" = xyes ]; then \
218 $(COMPILE.cc) $(PICFLAG) -DF \
219 `for N in $(COMIO); do echo " -D$${N}"; done` \
220 $(srcdir)/cinst.cc -o pic/fcomio.o; \
221 else true ; fi
222 $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
223 $(srcdir)/cinst.cc -o fcomio.o
224 echo dcomplex
225 if [ x"$(enable_shared)" = xyes ]; then \
226 $(COMPILE.cc) $(PICFLAG) -DD \
227 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
228 $(srcdir)/cinst.cc -o pic/dcomplex.o; \
229 else true ; fi
230 $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
231 $(srcdir)/cinst.cc -o dcomplex.o
232 echo dcomio
233 if [ x"$(enable_shared)" = xyes ]; then \
234 $(COMPILE.cc) $(PICFLAG) -DD \
235 `for N in $(COMIO); do echo " -D$${N}"; done` \
236 $(srcdir)/cinst.cc -o pic/dcomio.o; \
237 else true ; fi
238 $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
239 $(srcdir)/cinst.cc -o dcomio.o
240 echo ldcomplex
241 if [ x"$(enable_shared)" = xyes ]; then \
242 $(COMPILE.cc) $(PICFLAG) -DLD \
243 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
244 $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
245 else true ; fi
246 $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
247 $(srcdir)/cinst.cc -o ldcomplex.o
248 echo ldcomio
249 if [ x"$(enable_shared)" = xyes ]; then \
250 $(COMPILE.cc) $(PICFLAG) -DLD \
251 `for N in $(COMIO); do echo " -D$${N}"; done` \
252 $(srcdir)/cinst.cc -o pic/ldcomio.o; \
253 else true ; fi
254 $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
255 $(srcdir)/cinst.cc -o ldcomio.o
256 touch bigstmp-complx
257
258 .PHONY: install
259 install:
260 rootme=`pwd`/ ; export rootme ; \
261 if [ -z "$(MULTISUBDIR)" ]; then \
262 cd $(srcdir); \
263 for FILE in $(HEADERS); do \
264 rm -f $(gxx_include_dir)/$$FILE ; \
265 if [ -f stl/$$FILE ]; then \
266 $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
267 else \
268 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
269 fi ; \
270 chmod a-x $(gxx_include_dir)/$$FILE ; \
271 done ; \
272 for FILE in *.h std/*.h std/*.cc; do \
273 rm -f $(gxx_include_dir)/$$FILE ; \
274 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
275 chmod a-x $(gxx_include_dir)/$$FILE ; \
276 done ; \
277 cd stl; \
278 for FILE in *.h; do \
279 rm -f $(gxx_include_dir)/$$FILE ; \
280 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
281 chmod a-x $(gxx_include_dir)/$$FILE ; \
282 done ; \
283 else true ; \
284 fi
285 rootme=`pwd`/ ; export rootme ; \
286 if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
287 INSTALLDIR=$(libdir); \
288 else \
289 INSTALLDIR=$(libsubdir); \
290 fi; \
291 INSTALLLINKDIR=$(libsubdir); \
292 if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
293 RELINSTALLDIR=; \
294 elif [ x$(MULTISUBDIR) = x ]; then \
295 if [ $(build_alias) = $(target_alias) ]; then \
296 RELINSTALLDIR=../../../; \
297 else \
298 RELINSTALLDIR=../../../../$(target_alias)/lib/; \
299 fi; \
300 else \
301 if [ $(build_alias) = $(target_alias) ]; then \
302 RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
303 else \
304 RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
305 fi; \
306 fi; \
307 if [ $(build_alias) != $(target_alias) ]; then \
308 case $$RELINSTALLDIR in \
309 ../../../|../../../../) \
310 RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
311 esac; \
312 fi; \
313 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
314 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
315 for FILE in $(LIBS) ; do \
316 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
317 if [ $$FILE = $(SHLINK) ] ; then \
318 if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
319 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
320 $(LN_S) $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
321 || cp $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
322 else \
323 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
324 $(LN_S) $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
325 || cp $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
326 fi; \
327 elif [ $$FILE = $(ARLINK) ] ; then \
328 if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
329 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
330 $(LN_S) $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
331 || cp $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
332 else \
333 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
334 $(LN_S) $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE \
335 || cp $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
336 fi; \
337 elif [ $$FILE = mshlink ]; then \
338 for FILE in $(MSHLINK) ; do \
339 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
340 $(LN_S) $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
341 || cp $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
342 done; \
343 elif [ $$FILE = marlink ]; then \
344 for FILE in $(MARLINK) ; do \
345 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
346 $(LN_S) $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE \
347 || cp $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
348 done; \
349 elif [ $$FILE = $(SHLIB) ]; then \
350 $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
351 : On the HP, shared libraries must be mode 555. ;\
352 chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
353 else \
354 $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
355 $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
356 chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
357 fi ; \
358 done
359 @rootme=`pwd`/ ; export rootme ; \
360 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
361
362 .PHONY: force
363 force:
364
365 MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -pedantic -Wno-long-long
366 MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
367
368 .PHONY: stuff
369 stuff:
370 $(MAKE) stuff1
371 $(MAKE) stuff2
372
373 stuff1:
374 $(MAKE) clean
375 $(MAKE) -C ../libio c++clean
376 touch ../../gcc/libgcc2.ready
377
378 stuff2:
379 $(MAKE) -C ../../gcc/ libgcc.a
380 $(MAKE) CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
381 -$(MAKE) check
382 -$(MAKE) -C ../libio check
383 -$(MAKE) -C ../../gcc check-g++