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