1 # Copyright (C) 1994, 1995 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.
20 OBJS = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o
21 SUBLIBS = $(STAMP)-string $(STAMP)-complx
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
31 ARLIB = libstdc++.a.$(VERSION)
33 MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
34 SHLIB = libstdc++.so.$(VERSION)
35 SHARLIB = libstdc++-sh.a
37 MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
43 LIBS = $(ARLIB) $(ARLINK)
45 #### package, host, target, and site dependent Makefile fragments come in here.
49 LIBIBERTY_DIR = ../libiberty
51 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
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)
58 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
64 stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
68 for f in `cat $(IO_DIR)/iostream.list` ; do \
69 echo "$(IO_DIR)/$$f" >> tlist ; \
71 for f in $(LIBIBERTY_OBJS) ; do \
72 echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
79 if [ x"$(enable_shared)" = xyes ]; then \
80 sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
87 $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
92 ln -f -s $(ARLIB) $(ARLINK)
95 @$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
98 $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
102 $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
103 mv t$(SHARLIB) $(SHARLIB)
107 ln -f -s $(SHLIB) $(SHLINK)
110 @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
112 $(IO_DIR)/iostream.list: force
113 cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
115 $(LIBIBERTY_DIR)/libiberty.a:
116 cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
118 STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
119 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
120 LESS LEPS LESP GESS GEPS GESP
121 STRIO = EXTRACT INSERT GETLINE
123 # These are here for SunOS VPATH.
124 cstringi.o: cstringi.cc
125 cstdlibi.o: cstdlibi.cc
127 stdexcepti.o: stdexcepti.cc
128 stlinst.o: stlinst.cc
130 # Later do wide strings, too.
131 stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
132 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
133 for name in $(STRFUNCS) $(STRIO); do \
135 if [ x"$(enable_shared)" = xyes ]; then \
136 $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
137 -o pic/c$${name}.o; \
139 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
140 $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
141 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
145 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
146 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
148 if [ x"$(enable_shared)" = xyes ]; then \
149 $(COMPILE.cc) $(PICFLAG) -DC \
150 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
151 $(srcdir)/sinst.cc -o pic/cstrmain.o; \
153 $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
154 $(srcdir)/sinst.cc -o cstrmain.o
156 if [ x"$(enable_shared)" = xyes ]; then \
157 $(COMPILE.cc) $(PICFLAG) -DC \
158 `for N in $(STRIO); do echo " -D$${N}"; done` \
159 $(srcdir)/sinst.cc -o pic/cstrio.o; \
161 $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
162 $(srcdir)/sinst.cc -o cstrio.o
165 COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
166 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
167 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
168 COMIO = EXTRACT INSERT
170 stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
171 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
172 ${srcdir}/std/ldcomplex.h
173 for N in $(COMFUNCS) $(COMIO); do \
175 if [ x"$(enable_shared)" = xyes ]; then \
176 $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
179 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
180 $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
181 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
183 if [ x"$(enable_shared)" = xyes ]; then \
184 $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
187 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
188 $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
189 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
191 if [ x"$(enable_shared)" = xyes ]; then \
192 $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
195 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
196 $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
197 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
201 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
202 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
203 ${srcdir}/std/ldcomplex.h
205 if [ x"$(enable_shared)" = xyes ]; then \
206 $(COMPILE.cc) $(PICFLAG) -DF \
207 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
208 $(srcdir)/cinst.cc -o pic/fcomplex.o; \
210 $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
211 $(srcdir)/cinst.cc -o fcomplex.o
213 if [ x"$(enable_shared)" = xyes ]; then \
214 $(COMPILE.cc) $(PICFLAG) -DF \
215 `for N in $(COMIO); do echo " -D$${N}"; done` \
216 $(srcdir)/cinst.cc -o pic/fcomio.o; \
218 $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
219 $(srcdir)/cinst.cc -o fcomio.o
221 if [ x"$(enable_shared)" = xyes ]; then \
222 $(COMPILE.cc) $(PICFLAG) -DD \
223 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
224 $(srcdir)/cinst.cc -o pic/dcomplex.o; \
226 $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
227 $(srcdir)/cinst.cc -o dcomplex.o
229 if [ x"$(enable_shared)" = xyes ]; then \
230 $(COMPILE.cc) $(PICFLAG) -DD \
231 `for N in $(COMIO); do echo " -D$${N}"; done` \
232 $(srcdir)/cinst.cc -o pic/dcomio.o; \
234 $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
235 $(srcdir)/cinst.cc -o dcomio.o
237 if [ x"$(enable_shared)" = xyes ]; then \
238 $(COMPILE.cc) $(PICFLAG) -DLD \
239 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
240 $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
242 $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
243 $(srcdir)/cinst.cc -o ldcomplex.o
245 if [ x"$(enable_shared)" = xyes ]; then \
246 $(COMPILE.cc) $(PICFLAG) -DLD \
247 `for N in $(COMIO); do echo " -D$${N}"; done` \
248 $(srcdir)/cinst.cc -o pic/ldcomio.o; \
250 $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
251 $(srcdir)/cinst.cc -o ldcomio.o
256 rootme=`pwd`/ ; export rootme ; \
257 if [ -z "$(MULTISUBDIR)" ]; then \
259 for FILE in $(HEADERS); do \
260 rm -f $(gxx_include_dir)/$$FILE ; \
261 if [ -f stl/$$FILE ]; then \
262 $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
264 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
266 chmod a-x $(gxx_include_dir)/$$FILE ; \
268 for FILE in *.h std/*.*; do \
269 rm -f $(gxx_include_dir)/$$FILE ; \
270 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
271 chmod a-x $(gxx_include_dir)/$$FILE ; \
274 for FILE in *.h; do \
275 rm -f $(gxx_include_dir)/$$FILE ; \
276 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
277 chmod a-x $(gxx_include_dir)/$$FILE ; \
281 rootme=`pwd`/ ; export rootme ; \
282 if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
283 INSTALLDIR=$(libdir); \
285 INSTALLDIR=$(libsubdir); \
287 INSTALLLINKDIR=$(libsubdir); \
288 if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
290 elif [ x$(MULTISUBDIR) = x ]; then \
291 if [ $(build_alias) = $(target_alias) ]; then \
292 RELINSTALLDIR=../../../; \
294 RELINSTALLDIR=../../../../$(target_alias)/lib/; \
297 if [ $(build_alias) = $(target_alias) ]; then \
298 RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
300 RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
303 if [ $(build_alias) != $(target_alias) ]; then \
304 case $$RELINSTALLDIR in \
305 ../../../|../../../../) \
306 RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
309 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
310 rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
311 for FILE in $(LIBS) ; do \
312 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
313 if [ $$FILE = $(SHLINK) ] ; then \
314 if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
315 ln -f -s $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
317 ln -f -s $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
319 elif [ $$FILE = $(ARLINK) ] ; then \
320 if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
321 ln -f -s $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
323 ln -f -s $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
325 elif [ $$FILE = mshlink ]; then \
326 for FILE in $(MSHLINK) ; do \
327 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
328 ln -f -s $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
330 elif [ $$FILE = marlink ]; then \
331 for FILE in $(MARLINK) ; do \
332 rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
333 ln -f -s $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
335 elif [ $$FILE = $(SHLIB) ]; then \
336 $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
337 : On the HP, shared libraries must be mode 555. ;\
338 chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
340 $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
341 $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
342 chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
345 @rootme=`pwd`/ ; export rootme ; \
346 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
351 # Remove these for public releases.
352 MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings
353 MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
362 $(MAKE) -C ../libio c++clean
363 touch ../../gcc/libgcc2.ready
366 -$(MAKE) -C ../../gcc/ libgcc.a
367 -$(MAKE) check CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
368 -$(MAKE) -C ../libio check
369 -$(MAKE) -C ../../gcc check-g++