1 # Copyright (C) 1994, 1995, 1999, 2000 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 gxx_include_dir
=${includedir}/g
++
22 OBJS
= cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o valarray.o \
23 del_op.o del_opnt.o del_opv.o del_opvnt.o exception.o new_handler.o \
24 new_op.o new_opnt.o new_opv.o new_opvnt.o tinfo.o tinfo2.o vec.o \
27 SUBLIBS
= $(STAMP
)-string
$(STAMP
)-complx
29 # C++ headers with no extension
30 HEADERS
= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
31 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
32 cwchar cwctype string stdexcept \
33 algorithm deque functional hash_map hash_set iterator list map \
34 memory numeric pthread_alloc queue rope set slist stack utility \
35 vector fstream iomanip iostream strstream iosfwd bitset valarray \
36 sstream exception new typeinfo
38 ARLIB
= libstdc
++.a.
$(VERSION
)
40 MARLINK
= libstdc
++.a.
`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
41 SHLIB
= libstdc
++.so.
$(VERSION
)
42 SHARLIB
= libstdc
++-sh.a
44 MSHLINK
= libstdc
++.so.
`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
51 LIBS
= $(ARLIB
) $(ARLINK
)
53 #### package, host, target, and site dependent Makefile fragments come in here.
57 LIBIBERTY_DIR
= ..
/libiberty
59 LIBIBERTY_OBJS
= `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
61 tooldir
= $(exec_prefix)/$(target
)
62 # This is where the libraries will be installed; note, it will be set
63 # at make runtime now. See below at target install.
64 INSTALLDIR
= $(libdir)
66 MOSTLYCLEAN_JUNK
= *stmp-
* tlib
*.a
*.s
*.ii stdlist piclist
72 # The "pic" subdir must be created before we can put any object
76 stdlist
: $(IO_DIR
)/iostream.list
$(OBJS
) $(SUBLIBS
) $(LIBIBERTY_DIR
)/libiberty.a
80 for f in
`cat $(IO_DIR)/iostream.list` ; do \
81 echo
"$(IO_DIR)/$$f" >> tlist
; \
83 for f in
$(LIBIBERTY_OBJS
) ; do \
84 echo
"$(LIBIBERTY_DIR)/$$f" >> tlist
; \
91 if
[ x
"$(PICFLAG)" != x
]; then \
92 sed
's,\([A-Za-z_0-9]*\.o\),pic/\1,g' tlist
> tlist2
; \
99 $(AR
) $(AR_FLAGS
) t
$(ARLIB
) `cat stdlist`
100 mv t
$(ARLIB
) $(ARLIB
)
105 $(LN_S
) $(ARLIB
) $(ARLINK
) || cp
$(ARLIB
) $(ARLINK
)
108 @
$(MAKE
) $(MARLINK
) "ARLINK=$(MARLINK)"
111 $(CC
) $(LIBCXXFLAGS
) $(SHFLAGS
) $(SHOPT
) -o
$(SHLIB
) `cat piclist` $(SHDEPS
)
115 $(AR
) $(AR_FLAGS
) t
$(SHARLIB
) $(SHLIB
)
116 mv t
$(SHARLIB
) $(SHARLIB
)
121 $(LN_S
) $(SHLIB
) $(SHLINK
) || cp
$(ARLIB
) $(ARLINK
)
124 @
$(MAKE
) $(MSHLINK
) "SHLINK=$(MSHLINK)"
126 $(IO_DIR
)/iostream.list
: force
127 cd
$(IO_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) iostream.list
129 $(LIBIBERTY_DIR
)/libiberty.a
:
130 cd
$(LIBIBERTY_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
)
132 STRFUNCS
= REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
133 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
134 LESS LEPS LESP GESS GEPS GESP
135 STRIO
= EXTRACT INSERT GETLINE
137 # These are here for SunOS VPATH.
140 cstdlibi.o
: cstdlibi.
cc
141 cstringi.o
: cstringi.
cc
142 del_op.o
: del_op.
cc new
143 del_opnt.o
: del_opnt.
cc new
144 del_opv.o
: del_opv.
cc new
145 del_opvnt.o
: del_opvnt.
cc new
146 exception.o
: exception.
cc typeinfo
$(srcdir)/..
/gcc
/gansidecl.h \
147 $(srcdir)/..
/include/ansidecl.h
$(srcdir)/..
/gcc
/eh-common.h
148 new_handler.o
: new_handler.
cc new
149 new_op.o
: new_op.
cc new
150 new_opnt.o
: new_opnt.
cc new
151 new_opv.o
: new_opv.
cc new
152 new_opvnt.o
: new_opvnt.
cc new
154 stdexcepti.o
: stdexcepti.
cc
155 stlinst.o
: stlinst.
cc
156 tinfo.o
: tinfo.
cc tinfo.hP typeinfo new
157 tinfo2.o
: tinfo2.
cc tinfo.hP typeinfo new
158 valarray.o
: valarray.
cc
162 # Later do wide strings, too.
163 stmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
164 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
165 for name in
$(STRFUNCS
) $(STRIO
); do \
167 if
[ x
"$(PICFLAG)" != x
]; then \
168 $(COMPILE.
cc) $(PICFLAG
) -DC
-D
$${name} ${srcdir}/sinst.
cc \
169 -o pic
/c
$${name}.o
; \
171 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
172 $(COMPILE.
cc) -DC
-D
$${name} ${srcdir}/sinst.
cc -o c
$${name}.o
; \
173 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
177 bigstmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
178 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
180 if
[ x
"$(PICFLAG)" != x
]; then \
181 $(COMPILE.
cc) $(PICFLAG
) -DC \
182 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
183 $(srcdir)/sinst.
cc -o pic
/cstrmain.o
; \
185 $(COMPILE.
cc) -DC
`for N in $(STRFUNCS); do echo " -D$${N}"; done` \
186 $(srcdir)/sinst.
cc -o cstrmain.o
188 if
[ x
"$(PICFLAG)" != x
]; then \
189 $(COMPILE.
cc) $(PICFLAG
) -DC \
190 `for N in $(STRIO); do echo " -D$${N}"; done` \
191 $(srcdir)/sinst.
cc -o pic
/cstrio.o
; \
193 $(COMPILE.
cc) -DC
`for N in $(STRIO); do echo " -D$${N}"; done` \
194 $(srcdir)/sinst.
cc -o cstrio.o
197 COMFUNCS
= MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
198 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
199 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
200 COMIO
= EXTRACT INSERT
202 stmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
203 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
204 ${srcdir}/std
/ldcomplex.h
205 for N in
$(COMFUNCS
) $(COMIO
); do \
207 if
[ x
"$(PICFLAG)" != x
]; then \
208 $(COMPILE.
cc) $(PICFLAG
) -DF
-D
$${N} $(srcdir)/cinst.
cc \
211 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
212 $(COMPILE.
cc) -DF
-D
$${N} ${srcdir}/cinst.
cc -o f
$${N}.o
; \
213 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
215 if
[ x
"$(PICFLAG)" != x
]; then \
216 $(COMPILE.
cc) $(PICFLAG
) -DD
-D
$${N} $(srcdir)/cinst.
cc \
219 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
220 $(COMPILE.
cc) -DD
-D
$${N} ${srcdir}/cinst.
cc -o d
$${N}.o
; \
221 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
223 if
[ x
"$(PICFLAG)" != x
]; then \
224 $(COMPILE.
cc) $(PICFLAG
) -DLD
-D
$${N} $(srcdir)/cinst.
cc \
227 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
228 $(COMPILE.
cc) -DLD
-D
$${N} ${srcdir}/cinst.
cc -o
ld$${N}.o
; \
229 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
233 bigstmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
234 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
235 ${srcdir}/std
/ldcomplex.h
237 if
[ x
"$(PICFLAG)" != x
]; then \
238 $(COMPILE.
cc) $(PICFLAG
) -DF \
239 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
240 $(srcdir)/cinst.
cc -o pic
/fcomplex.o
; \
242 $(COMPILE.
cc) -DF
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
243 $(srcdir)/cinst.
cc -o fcomplex.o
245 if
[ x
"$(PICFLAG)" != x
]; then \
246 $(COMPILE.
cc) $(PICFLAG
) -DF \
247 `for N in $(COMIO); do echo " -D$${N}"; done` \
248 $(srcdir)/cinst.
cc -o pic
/fcomio.o
; \
250 $(COMPILE.
cc) -DF
`for N in $(COMIO); do echo " -D$${N}"; done` \
251 $(srcdir)/cinst.
cc -o fcomio.o
253 if
[ x
"$(PICFLAG)" != x
]; then \
254 $(COMPILE.
cc) $(PICFLAG
) -DD \
255 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
256 $(srcdir)/cinst.
cc -o pic
/dcomplex.o
; \
258 $(COMPILE.
cc) -DD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
259 $(srcdir)/cinst.
cc -o dcomplex.o
261 if
[ x
"$(PICFLAG)" != x
]; then \
262 $(COMPILE.
cc) $(PICFLAG
) -DD \
263 `for N in $(COMIO); do echo " -D$${N}"; done` \
264 $(srcdir)/cinst.
cc -o pic
/dcomio.o
; \
266 $(COMPILE.
cc) -DD
`for N in $(COMIO); do echo " -D$${N}"; done` \
267 $(srcdir)/cinst.
cc -o dcomio.o
269 if
[ x
"$(PICFLAG)" != x
]; then \
270 $(COMPILE.
cc) $(PICFLAG
) -DLD \
271 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
272 $(srcdir)/cinst.
cc -o pic
/ldcomplex.o
; \
274 $(COMPILE.
cc) -DLD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
275 $(srcdir)/cinst.
cc -o ldcomplex.o
277 if
[ x
"$(PICFLAG)" != x
]; then \
278 $(COMPILE.
cc) $(PICFLAG
) -DLD \
279 `for N in $(COMIO); do echo " -D$${N}"; done` \
280 $(srcdir)/cinst.
cc -o pic
/ldcomio.o
; \
282 $(COMPILE.
cc) -DLD
`for N in $(COMIO); do echo " -D$${N}"; done` \
283 $(srcdir)/cinst.
cc -o ldcomio.o
288 rootme
=`pwd`/ ; export rootme
; \
289 if
[ -z
"$(MULTISUBDIR)" ]; then \
291 for FILE in
$(HEADERS
); do \
292 rm -f
$(gxx_include_dir
)/$$FILE ; \
293 if
[ -f stl
/$$FILE ]; then \
294 $(INSTALL_DATA
) stl
/$$FILE $(gxx_include_dir
)/$$FILE ; \
296 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
298 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
300 for FILE in
*.h std
/*.h std
/*.
cc std
/*.tcc
; do \
301 rm -f
$(gxx_include_dir
)/$$FILE ; \
302 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
303 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
306 for FILE in
*.h
; do \
307 rm -f
$(gxx_include_dir
)/$$FILE ; \
308 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
309 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
313 rootme
=`pwd`/ ; export rootme
; \
314 if
[ x
$(enable_version_specific_runtime_libs
) != xyes
]; then \
315 INSTALLDIR
=$(libdir); \
317 INSTALLDIR
=$(libsubdir
); \
319 INSTALLLINKDIR
=$(libsubdir
); \
320 if
[ $${INSTALLLINKDIR}$(MULTISUBDIR
) = $${INSTALLDIR}$(MULTISUBDIR
) ]; then \
322 elif
[ x
$(MULTISUBDIR
) = x
]; then \
323 if
[ $(build_alias
) = $(target_alias
) ]; then \
324 RELINSTALLDIR
=..
/..
/..
/; \
326 RELINSTALLDIR
=..
/..
/..
/..
/$(target_alias
)/lib
/; \
329 if
[ $(build_alias
) = $(target_alias
) ]; then \
330 RELINSTALLDIR
=..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR
)/; \
332 RELINSTALLDIR
=..
/..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias
)/lib
$(MULTISUBDIR
)/; \
335 if
[ $(build_alias
) != $(target_alias
) ]; then \
336 case
$$RELINSTALLDIR in \
337 ..
/..
/..
/|..
/..
/..
/..
/) \
338 RELINSTALLDIR
=..
/$${RELINSTALLDIR}$(target_alias
)/lib
/;; \
341 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(SHLINK
) ; \
342 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(ARLINK
) ; \
343 for FILE in
$(LIBS
) ; do \
344 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
345 if
[ $$FILE = $(SHLINK
) ] ; then \
346 if
[ -f
$${INSTALLDIR}/$(MSHLINK
) ]; then \
347 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
348 $(LN_S
) $${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
349 || cp
$${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
351 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
352 $(LN_S
) $${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
353 || cp
$${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
355 elif
[ $$FILE = $(ARLINK
) ] ; then \
356 if
[ -f
$${INSTALLDIR}/$(MARLINK
) ]; then \
357 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
358 $(LN_S
) $${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
359 || cp
$${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
361 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
362 $(LN_S
) $${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
363 || cp
$${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
365 elif
[ $$FILE = mshlink
]; then \
366 for FILE in
$(MSHLINK
) ; do \
367 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
368 $(LN_S
) $(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE \
369 || cp
$(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
371 elif
[ $$FILE = marlink
]; then \
372 for FILE in
$(MARLINK
) ; do \
373 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
374 $(LN_S
) $(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE \
375 || cp
$(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
377 elif
[ $$FILE = $(SHLIB
) ]; then \
378 $(INSTALL_PROGRAM
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
379 : On the HP
, shared libraries must be mode
555.
;\
380 chmod
555 $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
382 $(INSTALL_DATA
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
383 $(RANLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
384 chmod a-x
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
387 @rootme
=`pwd`/ ; export rootme
; \
388 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
393 MYCXXFLAGS
= $(CXXFLAGS
) -g
-O2
-Wpointer-arith
-Wnested-externs
-Woverloaded-virtual
-Wbad-function-cast
-Winline
-Wwrite-strings
-pedantic
-Wno-long-long
394 MYCFLAGS
= $(CFLAGS
) -g
-O2
-Wpointer-arith
-Wnested-externs
403 $(MAKE
) -C ..
/libio c
++clean
404 rm -f ..
/..
/gcc
/cplib2.txt
407 $(MAKE
) -C ..
/..
/gcc
/ LANGUAGES
='c c++' libgcc.a
408 $(MAKE
) CXXFLAGS
="$(MYCXXFLAGS)" CFLAGS
="$(MYCFLAGS)"
410 -$(MAKE
) -C ..
/libio
check
411 -$(MAKE
) -C ..
/..
/gcc check-g
++