1 # Copyright (C) 1994, 1995, 1999 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 SUBLIBS
= $(STAMP
)-string
$(STAMP
)-complx
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 valarray
33 ARLIB
= libstdc
++.a.
$(VERSION
)
35 MARLINK
= libstdc
++.a.
`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
36 SHLIB
= libstdc
++.so.
$(VERSION
)
37 SHARLIB
= libstdc
++-sh.a
39 MSHLINK
= libstdc
++.so.
`echo $(VERSION) | sed 's/\([0-9]*[.][0-9]*\).*/\1/'`
46 LIBS
= $(ARLIB
) $(ARLINK
)
48 #### package, host, target, and site dependent Makefile fragments come in here.
52 LIBIBERTY_DIR
= ..
/libiberty
54 LIBIBERTY_OBJS
= `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
56 tooldir
= $(exec_prefix)/$(target
)
57 # This is where the libraries will be installed; note, it will be set
58 # at make runtime now. See below at target install.
59 INSTALLDIR
= $(libdir)
61 MOSTLYCLEAN_JUNK
= *stmp-
* tlib
*.a
*.s
*.ii stdlist piclist
67 # The "pic" subdir must be created before we can put any object
71 stdlist
: $(IO_DIR
)/iostream.list
$(OBJS
) $(SUBLIBS
) $(LIBIBERTY_DIR
)/libiberty.a
75 for f in
`cat $(IO_DIR)/iostream.list` ; do \
76 echo
"$(IO_DIR)/$$f" >> tlist
; \
78 for f in
$(LIBIBERTY_OBJS
) ; do \
79 echo
"$(LIBIBERTY_DIR)/$$f" >> tlist
; \
86 if
[ x
"$(enable_shared)" = xyes
]; then \
87 sed
's,\([A-Za-z_]*\.o\),pic/\1,g' tlist
> tlist2
; \
94 $(AR
) $(AR_FLAGS
) t
$(ARLIB
) `cat stdlist`
100 $(LN_S
) $(ARLIB
) $(ARLINK
) || cp
$(ARLIB
) $(ARLINK
)
103 @
$(MAKE
) $(MARLINK
) "ARLINK=$(MARLINK)"
106 $(CC
) $(LIBCXXFLAGS
) $(SHFLAGS
) $(SHOPT
) -o
$(SHLIB
) `cat piclist` $(SHDEPS
)
110 $(AR
) $(AR_FLAGS
) t
$(SHARLIB
) $(SHLIB
)
111 mv t
$(SHARLIB
) $(SHARLIB
)
116 $(LN_S
) $(SHLIB
) $(SHLINK
) || cp
$(ARLIB
) $(ARLINK
)
119 @
$(MAKE
) $(MSHLINK
) "SHLINK=$(MSHLINK)"
121 $(IO_DIR
)/iostream.list
: force
122 cd
$(IO_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) iostream.list
124 $(LIBIBERTY_DIR
)/libiberty.a
:
125 cd
$(LIBIBERTY_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
)
127 STRFUNCS
= REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
128 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
129 LESS LEPS LESP GESS GEPS GESP
130 STRIO
= EXTRACT INSERT GETLINE
132 # These are here for SunOS VPATH.
133 cstringi.o
: cstringi.
cc
134 cstdlibi.o
: cstdlibi.
cc
136 stdexcepti.o
: stdexcepti.
cc
137 stlinst.o
: stlinst.
cc
138 valarray.o
: valarray.
cc
140 # Later do wide strings, too.
141 stmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
142 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
143 for name in
$(STRFUNCS
) $(STRIO
); do \
145 if
[ x
"$(enable_shared)" = xyes
]; then \
146 $(COMPILE.
cc) $(PICFLAG
) -DC
-D
$${name} ${srcdir}/sinst.
cc \
147 -o pic
/c
$${name}.o
; \
149 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
150 $(COMPILE.
cc) -DC
-D
$${name} ${srcdir}/sinst.
cc -o c
$${name}.o
; \
151 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
155 bigstmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
156 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
158 if
[ x
"$(enable_shared)" = xyes
]; then \
159 $(COMPILE.
cc) $(PICFLAG
) -DC \
160 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
161 $(srcdir)/sinst.
cc -o pic
/cstrmain.o
; \
163 $(COMPILE.
cc) -DC
`for N in $(STRFUNCS); do echo " -D$${N}"; done` \
164 $(srcdir)/sinst.
cc -o cstrmain.o
166 if
[ x
"$(enable_shared)" = xyes
]; then \
167 $(COMPILE.
cc) $(PICFLAG
) -DC \
168 `for N in $(STRIO); do echo " -D$${N}"; done` \
169 $(srcdir)/sinst.
cc -o pic
/cstrio.o
; \
171 $(COMPILE.
cc) -DC
`for N in $(STRIO); do echo " -D$${N}"; done` \
172 $(srcdir)/sinst.
cc -o cstrio.o
175 COMFUNCS
= MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
176 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
177 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
178 COMIO
= EXTRACT INSERT
180 stmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
181 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
182 ${srcdir}/std
/ldcomplex.h
183 for N in
$(COMFUNCS
) $(COMIO
); do \
185 if
[ x
"$(enable_shared)" = xyes
]; then \
186 $(COMPILE.
cc) $(PICFLAG
) -DF
-D
$${N} $(srcdir)/cinst.
cc \
189 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
190 $(COMPILE.
cc) -DF
-D
$${N} ${srcdir}/cinst.
cc -o f
$${N}.o
; \
191 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
193 if
[ x
"$(enable_shared)" = xyes
]; then \
194 $(COMPILE.
cc) $(PICFLAG
) -DD
-D
$${N} $(srcdir)/cinst.
cc \
197 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
198 $(COMPILE.
cc) -DD
-D
$${N} ${srcdir}/cinst.
cc -o d
$${N}.o
; \
199 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
201 if
[ x
"$(enable_shared)" = xyes
]; then \
202 $(COMPILE.
cc) $(PICFLAG
) -DLD
-D
$${N} $(srcdir)/cinst.
cc \
205 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
206 $(COMPILE.
cc) -DLD
-D
$${N} ${srcdir}/cinst.
cc -o
ld$${N}.o
; \
207 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
211 bigstmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
212 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
213 ${srcdir}/std
/ldcomplex.h
215 if
[ x
"$(enable_shared)" = xyes
]; then \
216 $(COMPILE.
cc) $(PICFLAG
) -DF \
217 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
218 $(srcdir)/cinst.
cc -o pic
/fcomplex.o
; \
220 $(COMPILE.
cc) -DF
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
221 $(srcdir)/cinst.
cc -o fcomplex.o
223 if
[ x
"$(enable_shared)" = xyes
]; then \
224 $(COMPILE.
cc) $(PICFLAG
) -DF \
225 `for N in $(COMIO); do echo " -D$${N}"; done` \
226 $(srcdir)/cinst.
cc -o pic
/fcomio.o
; \
228 $(COMPILE.
cc) -DF
`for N in $(COMIO); do echo " -D$${N}"; done` \
229 $(srcdir)/cinst.
cc -o fcomio.o
231 if
[ x
"$(enable_shared)" = xyes
]; then \
232 $(COMPILE.
cc) $(PICFLAG
) -DD \
233 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
234 $(srcdir)/cinst.
cc -o pic
/dcomplex.o
; \
236 $(COMPILE.
cc) -DD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
237 $(srcdir)/cinst.
cc -o dcomplex.o
239 if
[ x
"$(enable_shared)" = xyes
]; then \
240 $(COMPILE.
cc) $(PICFLAG
) -DD \
241 `for N in $(COMIO); do echo " -D$${N}"; done` \
242 $(srcdir)/cinst.
cc -o pic
/dcomio.o
; \
244 $(COMPILE.
cc) -DD
`for N in $(COMIO); do echo " -D$${N}"; done` \
245 $(srcdir)/cinst.
cc -o dcomio.o
247 if
[ x
"$(enable_shared)" = xyes
]; then \
248 $(COMPILE.
cc) $(PICFLAG
) -DLD \
249 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
250 $(srcdir)/cinst.
cc -o pic
/ldcomplex.o
; \
252 $(COMPILE.
cc) -DLD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
253 $(srcdir)/cinst.
cc -o ldcomplex.o
255 if
[ x
"$(enable_shared)" = xyes
]; then \
256 $(COMPILE.
cc) $(PICFLAG
) -DLD \
257 `for N in $(COMIO); do echo " -D$${N}"; done` \
258 $(srcdir)/cinst.
cc -o pic
/ldcomio.o
; \
260 $(COMPILE.
cc) -DLD
`for N in $(COMIO); do echo " -D$${N}"; done` \
261 $(srcdir)/cinst.
cc -o ldcomio.o
266 rootme
=`pwd`/ ; export rootme
; \
267 if
[ -z
"$(MULTISUBDIR)" ]; then \
269 for FILE in
$(HEADERS
); do \
270 rm -f
$(gxx_include_dir
)/$$FILE ; \
271 if
[ -f stl
/$$FILE ]; then \
272 $(INSTALL_DATA
) stl
/$$FILE $(gxx_include_dir
)/$$FILE ; \
274 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
276 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
278 for FILE in
*.h std
/*.h std
/*.
cc std
/*.tcc
; do \
279 rm -f
$(gxx_include_dir
)/$$FILE ; \
280 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
281 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
284 for FILE in
*.h
; do \
285 rm -f
$(gxx_include_dir
)/$$FILE ; \
286 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
287 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
291 rootme
=`pwd`/ ; export rootme
; \
292 if
[ x
$(enable_version_specific_runtime_libs
) != xyes
]; then \
293 INSTALLDIR
=$(libdir); \
295 INSTALLDIR
=$(libsubdir
); \
297 INSTALLLINKDIR
=$(libsubdir
); \
298 if
[ $${INSTALLLINKDIR}$(MULTISUBDIR
) = $${INSTALLDIR}$(MULTISUBDIR
) ]; then \
300 elif
[ x
$(MULTISUBDIR
) = x
]; then \
301 if
[ $(build_alias
) = $(target_alias
) ]; then \
302 RELINSTALLDIR
=..
/..
/..
/; \
304 RELINSTALLDIR
=..
/..
/..
/..
/$(target_alias
)/lib
/; \
307 if
[ $(build_alias
) = $(target_alias
) ]; then \
308 RELINSTALLDIR
=..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR
)/; \
310 RELINSTALLDIR
=..
/..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias
)/lib
$(MULTISUBDIR
)/; \
313 if
[ $(build_alias
) != $(target_alias
) ]; then \
314 case
$$RELINSTALLDIR in \
315 ..
/..
/..
/|..
/..
/..
/..
/) \
316 RELINSTALLDIR
=..
/$${RELINSTALLDIR}$(target_alias
)/lib
/;; \
319 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(SHLINK
) ; \
320 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(ARLINK
) ; \
321 for FILE in
$(LIBS
) ; do \
322 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
323 if
[ $$FILE = $(SHLINK
) ] ; then \
324 if
[ -f
$${INSTALLDIR}/$(MSHLINK
) ]; then \
325 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
326 $(LN_S
) $${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
327 || cp
$${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
329 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
330 $(LN_S
) $${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
331 || cp
$${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
333 elif
[ $$FILE = $(ARLINK
) ] ; then \
334 if
[ -f
$${INSTALLDIR}/$(MARLINK
) ]; then \
335 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
336 $(LN_S
) $${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
337 || cp
$${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
339 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
340 $(LN_S
) $${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
341 || cp
$${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
343 elif
[ $$FILE = mshlink
]; then \
344 for FILE in
$(MSHLINK
) ; do \
345 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
346 $(LN_S
) $(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE \
347 || cp
$(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
349 elif
[ $$FILE = marlink
]; then \
350 for FILE in
$(MARLINK
) ; do \
351 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
352 $(LN_S
) $(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE \
353 || cp
$(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
355 elif
[ $$FILE = $(SHLIB
) ]; then \
356 $(INSTALL_PROGRAM
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
357 : On the HP
, shared libraries must be mode
555.
;\
358 chmod
555 $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
360 $(INSTALL_DATA
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
361 $(RANLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
362 chmod a-x
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
365 @rootme
=`pwd`/ ; export rootme
; \
366 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
371 MYCXXFLAGS
= $(CXXFLAGS
) -g
-O2
-Wpointer-arith
-Wnested-externs
-Woverloaded-virtual
-Wbad-function-cast
-Winline
-Wwrite-strings
-pedantic
-Wno-long-long
372 MYCFLAGS
= $(CFLAGS
) -g
-O2
-Wpointer-arith
-Wnested-externs
381 $(MAKE
) -C ..
/libio c
++clean
382 touch ..
/..
/gcc
/libgcc2.ready
385 $(MAKE
) -C ..
/..
/gcc
/ libgcc.a
386 $(MAKE
) CXXFLAGS
="$(MYCXXFLAGS)" CFLAGS
="$(MYCFLAGS)"
388 -$(MAKE
) -C ..
/libio
check
389 -$(MAKE
) -C ..
/..
/gcc check-g
++