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.
19 OBJS = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o
20 SUBLIBS = $(STAMP)-string $(STAMP)-complx
22 # C++ headers with no extension
23 HEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
24 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
25 cwchar cwctype string stdexcept \
26 algorithm deque functional hash_map hash_set iterator list map \
27 memory numeric pthread_alloc queue rope set slist stack utility \
28 vector fstream iomanip iostream strstream iosfwd
31 SHLIB = libstdc++.so.$(VERSION)
32 SHARLIB = libstdc++-sh.a
34 MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
42 #### package, host, target, and site dependent Makefile fragments come in here.
46 LIBIBERTY_DIR = ../libiberty
48 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
50 tooldir = $(exec_prefix)/$(target)
51 INSTALLDIR = $(libdir)
53 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
56 # Remove these for public releases.
57 CXXFLAGS = -g -O -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings -Weffc++
58 CFLAGS = -g -O -Wpointer-arith -Wnested-externs
63 stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
67 for f in `cat $(IO_DIR)/iostream.list` ; do \
68 echo "$(IO_DIR)/$$f" >> tlist ; \
70 for f in $(LIBIBERTY_OBJS) ; do \
71 echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
78 if [ x"$(enable_shared)" = xyes ]; then \
79 sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
86 $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
91 $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
95 $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
96 mv t$(SHARLIB) $(SHARLIB)
100 ln -f -s $(SHLIB) $(SHLINK)
103 @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
105 $(IO_DIR)/iostream.list: force
106 cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
108 $(LIBIBERTY_DIR)/libiberty.a:
109 cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
111 STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
112 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
113 LESS LEPS LESP GESS GEPS GESP
114 STRIO = EXTRACT INSERT GETLINE
116 # These are here for SunOS VPATH.
117 cstringi.o: cstringi.cc
118 cstdlibi.o: cstdlibi.cc
120 stdexcepti.o: stdexcepti.cc
121 stlinst.o: stlinst.cc
123 # Later do wide strings, too.
124 stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
125 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
126 for name in $(STRFUNCS) $(STRIO); do \
128 if [ x"$(enable_shared)" = xyes ]; then \
129 $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
130 -o pic/c$${name}.o; \
132 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
133 $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
134 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
138 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
139 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
141 if [ x"$(enable_shared)" = xyes ]; then \
142 $(COMPILE.cc) $(PICFLAG) -DC \
143 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
144 $(srcdir)/sinst.cc -o pic/cstrmain.o; \
146 $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
147 $(srcdir)/sinst.cc -o cstrmain.o
149 if [ x"$(enable_shared)" = xyes ]; then \
150 $(COMPILE.cc) $(PICFLAG) -DC \
151 `for N in $(STRIO); do echo " -D$${N}"; done` \
152 $(srcdir)/sinst.cc -o pic/cstrio.o; \
154 $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
155 $(srcdir)/sinst.cc -o cstrio.o
158 COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
159 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
160 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
161 COMIO = EXTRACT INSERT
163 stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
164 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
165 ${srcdir}/std/ldcomplex.h
166 for N in $(COMFUNCS) $(COMIO); do \
168 if [ x"$(enable_shared)" = xyes ]; then \
169 $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
172 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
173 $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
174 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
176 if [ x"$(enable_shared)" = xyes ]; then \
177 $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
180 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
181 $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
182 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
184 if [ x"$(enable_shared)" = xyes ]; then \
185 $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
188 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
189 $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
190 if [ $$? -eq 0 ]; then true; else exit 1; fi; \
194 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
195 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
196 ${srcdir}/std/ldcomplex.h
198 if [ x"$(enable_shared)" = xyes ]; then \
199 $(COMPILE.cc) $(PICFLAG) -DF \
200 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
201 $(srcdir)/cinst.cc -o pic/fcomplex.o; \
203 $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
204 $(srcdir)/cinst.cc -o fcomplex.o
206 if [ x"$(enable_shared)" = xyes ]; then \
207 $(COMPILE.cc) $(PICFLAG) -DF \
208 `for N in $(COMIO); do echo " -D$${N}"; done` \
209 $(srcdir)/cinst.cc -o pic/fcomio.o; \
211 $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
212 $(srcdir)/cinst.cc -o fcomio.o
214 if [ x"$(enable_shared)" = xyes ]; then \
215 $(COMPILE.cc) $(PICFLAG) -DD \
216 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
217 $(srcdir)/cinst.cc -o pic/dcomplex.o; \
219 $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
220 $(srcdir)/cinst.cc -o dcomplex.o
222 if [ x"$(enable_shared)" = xyes ]; then \
223 $(COMPILE.cc) $(PICFLAG) -DD \
224 `for N in $(COMIO); do echo " -D$${N}"; done` \
225 $(srcdir)/cinst.cc -o pic/dcomio.o; \
227 $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
228 $(srcdir)/cinst.cc -o dcomio.o
230 if [ x"$(enable_shared)" = xyes ]; then \
231 $(COMPILE.cc) $(PICFLAG) -DLD \
232 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
233 $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
235 $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
236 $(srcdir)/cinst.cc -o ldcomplex.o
238 if [ x"$(enable_shared)" = xyes ]; then \
239 $(COMPILE.cc) $(PICFLAG) -DLD \
240 `for N in $(COMIO); do echo " -D$${N}"; done` \
241 $(srcdir)/cinst.cc -o pic/ldcomio.o; \
243 $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
244 $(srcdir)/cinst.cc -o ldcomio.o
249 rootme=`pwd`/ ; export rootme ; \
250 if [ -z "$(MULTISUBDIR)" ]; then \
252 for FILE in $(HEADERS); do \
253 rm -f $(gxx_include_dir)/$$FILE ; \
254 if [ -f stl/$$FILE ]; then \
255 $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
257 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
259 chmod a-x $(gxx_include_dir)/$$FILE ; \
261 for FILE in *.h std/*.*; do \
262 rm -f $(gxx_include_dir)/$$FILE ; \
263 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
264 chmod a-x $(gxx_include_dir)/$$FILE ; \
267 for FILE in *.h; do \
268 rm -f $(gxx_include_dir)/$$FILE ; \
269 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
270 chmod a-x $(gxx_include_dir)/$$FILE ; \
274 rootme=`pwd`/ ; export rootme ; \
275 rm -f $(INSTALLDIR)$(MULTISUBDIR)/$(SHLINK) ; \
276 for FILE in $(LIBS) ; do \
277 rm -f $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
278 if [ $$FILE = $(SHLINK) ] ; then \
279 ln -f -s $(SHLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
280 elif [ $$FILE = mshlink ]; then \
281 for FILE in $(MSHLINK) ; do \
282 rm -f $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
283 ln -f -s $(SHLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
285 elif [ $$FILE = $(SHLIB) ]; then \
286 $(INSTALL_PROGRAM) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
287 : On the HP, shared libraries must be mode 555. ;\
288 chmod 555 $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
290 $(INSTALL_DATA) $$FILE $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
291 $(RANLIB) $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
292 chmod a-x $(INSTALLDIR)$(MULTISUBDIR)/$$FILE ; \
295 @rootme=`pwd`/ ; export rootme ; \
296 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
304 $(MAKE) -C ../libio c++clean
305 -$(MAKE) $(MAKEFLAGS) check
306 -$(MAKE) -C ../libio check
307 -$(MAKE) -C ../gcc check-g++
311 $(MAKE) -C ../libio c++clean
315 -$(MAKE) -C ../libio check
316 -$(MAKE) -C ../gcc check-g++