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/'`
45 LIBS
= $(ARLIB
) $(ARLINK
)
47 #### package, host, target, and site dependent Makefile fragments come in here.
51 LIBIBERTY_DIR
= ..
/libiberty
53 LIBIBERTY_OBJS
= `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
55 tooldir
= $(exec_prefix)/$(target
)
56 # This is where the libraries will be installed; note, it will be set
57 # at make runtime now. See below at target install.
58 INSTALLDIR
= $(libdir)
60 MOSTLYCLEAN_JUNK
= *stmp-
* tlib
*.a
*.s
*.ii stdlist piclist
66 # The "pic" subdir must be created before we can put any object
70 stdlist
: $(IO_DIR
)/iostream.list
$(OBJS
) $(SUBLIBS
) $(LIBIBERTY_DIR
)/libiberty.a
74 for f in
`cat $(IO_DIR)/iostream.list` ; do \
75 echo
"$(IO_DIR)/$$f" >> tlist
; \
77 for f in
$(LIBIBERTY_OBJS
) ; do \
78 echo
"$(LIBIBERTY_DIR)/$$f" >> tlist
; \
85 if
[ x
"$(enable_shared)" = xyes
]; then \
86 sed
's,\([A-Za-z_]*\.o\),pic/\1,g' tlist
> tlist2
; \
93 $(AR
) $(AR_FLAGS
) t
$(ARLIB
) `cat stdlist`
99 $(LN_S
) $(ARLIB
) $(ARLINK
) || cp
$(ARLIB
) $(ARLINK
)
102 @
$(MAKE
) $(MARLINK
) "ARLINK=$(MARLINK)"
105 $(CC
) $(LIBCXXFLAGS
) $(SHFLAGS
) -shared
-o
$(SHLIB
) `cat piclist` $(SHDEPS
)
109 $(AR
) $(AR_FLAGS
) t
$(SHARLIB
) $(SHLIB
)
110 mv t
$(SHARLIB
) $(SHARLIB
)
115 $(LN_S
) $(SHLIB
) $(SHLINK
) || cp
$(ARLIB
) $(ARLINK
)
118 @
$(MAKE
) $(MSHLINK
) "SHLINK=$(MSHLINK)"
120 $(IO_DIR
)/iostream.list
: force
121 cd
$(IO_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) iostream.list
123 $(LIBIBERTY_DIR
)/libiberty.a
:
124 cd
$(LIBIBERTY_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
)
126 STRFUNCS
= REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
127 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
128 LESS LEPS LESP GESS GEPS GESP
129 STRIO
= EXTRACT INSERT GETLINE
131 # These are here for SunOS VPATH.
132 cstringi.o
: cstringi.
cc
133 cstdlibi.o
: cstdlibi.
cc
135 stdexcepti.o
: stdexcepti.
cc
136 stlinst.o
: stlinst.
cc
137 valarray.o
: valarray.
cc
139 # Later do wide strings, too.
140 stmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
141 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
142 for name in
$(STRFUNCS
) $(STRIO
); do \
144 if
[ x
"$(enable_shared)" = xyes
]; then \
145 $(COMPILE.
cc) $(PICFLAG
) -DC
-D
$${name} ${srcdir}/sinst.
cc \
146 -o pic
/c
$${name}.o
; \
148 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
149 $(COMPILE.
cc) -DC
-D
$${name} ${srcdir}/sinst.
cc -o c
$${name}.o
; \
150 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
154 bigstmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
155 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
157 if
[ x
"$(enable_shared)" = xyes
]; then \
158 $(COMPILE.
cc) $(PICFLAG
) -DC \
159 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
160 $(srcdir)/sinst.
cc -o pic
/cstrmain.o
; \
162 $(COMPILE.
cc) -DC
`for N in $(STRFUNCS); do echo " -D$${N}"; done` \
163 $(srcdir)/sinst.
cc -o cstrmain.o
165 if
[ x
"$(enable_shared)" = xyes
]; then \
166 $(COMPILE.
cc) $(PICFLAG
) -DC \
167 `for N in $(STRIO); do echo " -D$${N}"; done` \
168 $(srcdir)/sinst.
cc -o pic
/cstrio.o
; \
170 $(COMPILE.
cc) -DC
`for N in $(STRIO); do echo " -D$${N}"; done` \
171 $(srcdir)/sinst.
cc -o cstrio.o
174 COMFUNCS
= MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
175 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
176 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
177 COMIO
= EXTRACT INSERT
179 stmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
180 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
181 ${srcdir}/std
/ldcomplex.h
182 for N in
$(COMFUNCS
) $(COMIO
); do \
184 if
[ x
"$(enable_shared)" = xyes
]; then \
185 $(COMPILE.
cc) $(PICFLAG
) -DF
-D
$${N} $(srcdir)/cinst.
cc \
188 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
189 $(COMPILE.
cc) -DF
-D
$${N} ${srcdir}/cinst.
cc -o f
$${N}.o
; \
190 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
192 if
[ x
"$(enable_shared)" = xyes
]; then \
193 $(COMPILE.
cc) $(PICFLAG
) -DD
-D
$${N} $(srcdir)/cinst.
cc \
196 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
197 $(COMPILE.
cc) -DD
-D
$${N} ${srcdir}/cinst.
cc -o d
$${N}.o
; \
198 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
200 if
[ x
"$(enable_shared)" = xyes
]; then \
201 $(COMPILE.
cc) $(PICFLAG
) -DLD
-D
$${N} $(srcdir)/cinst.
cc \
204 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
205 $(COMPILE.
cc) -DLD
-D
$${N} ${srcdir}/cinst.
cc -o
ld$${N}.o
; \
206 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
210 bigstmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
211 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
212 ${srcdir}/std
/ldcomplex.h
214 if
[ x
"$(enable_shared)" = xyes
]; then \
215 $(COMPILE.
cc) $(PICFLAG
) -DF \
216 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
217 $(srcdir)/cinst.
cc -o pic
/fcomplex.o
; \
219 $(COMPILE.
cc) -DF
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
220 $(srcdir)/cinst.
cc -o fcomplex.o
222 if
[ x
"$(enable_shared)" = xyes
]; then \
223 $(COMPILE.
cc) $(PICFLAG
) -DF \
224 `for N in $(COMIO); do echo " -D$${N}"; done` \
225 $(srcdir)/cinst.
cc -o pic
/fcomio.o
; \
227 $(COMPILE.
cc) -DF
`for N in $(COMIO); do echo " -D$${N}"; done` \
228 $(srcdir)/cinst.
cc -o fcomio.o
230 if
[ x
"$(enable_shared)" = xyes
]; then \
231 $(COMPILE.
cc) $(PICFLAG
) -DD \
232 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
233 $(srcdir)/cinst.
cc -o pic
/dcomplex.o
; \
235 $(COMPILE.
cc) -DD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
236 $(srcdir)/cinst.
cc -o dcomplex.o
238 if
[ x
"$(enable_shared)" = xyes
]; then \
239 $(COMPILE.
cc) $(PICFLAG
) -DD \
240 `for N in $(COMIO); do echo " -D$${N}"; done` \
241 $(srcdir)/cinst.
cc -o pic
/dcomio.o
; \
243 $(COMPILE.
cc) -DD
`for N in $(COMIO); do echo " -D$${N}"; done` \
244 $(srcdir)/cinst.
cc -o dcomio.o
246 if
[ x
"$(enable_shared)" = xyes
]; then \
247 $(COMPILE.
cc) $(PICFLAG
) -DLD \
248 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
249 $(srcdir)/cinst.
cc -o pic
/ldcomplex.o
; \
251 $(COMPILE.
cc) -DLD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
252 $(srcdir)/cinst.
cc -o ldcomplex.o
254 if
[ x
"$(enable_shared)" = xyes
]; then \
255 $(COMPILE.
cc) $(PICFLAG
) -DLD \
256 `for N in $(COMIO); do echo " -D$${N}"; done` \
257 $(srcdir)/cinst.
cc -o pic
/ldcomio.o
; \
259 $(COMPILE.
cc) -DLD
`for N in $(COMIO); do echo " -D$${N}"; done` \
260 $(srcdir)/cinst.
cc -o ldcomio.o
265 rootme
=`pwd`/ ; export rootme
; \
266 if
[ -z
"$(MULTISUBDIR)" ]; then \
268 for FILE in
$(HEADERS
); do \
269 rm -f
$(gxx_include_dir
)/$$FILE ; \
270 if
[ -f stl
/$$FILE ]; then \
271 $(INSTALL_DATA
) stl
/$$FILE $(gxx_include_dir
)/$$FILE ; \
273 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
275 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
277 for FILE in
*.h std
/*.h std
/*.
cc std
/*.tcc
; do \
278 rm -f
$(gxx_include_dir
)/$$FILE ; \
279 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
280 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
283 for FILE in
*.h
; do \
284 rm -f
$(gxx_include_dir
)/$$FILE ; \
285 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
286 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
290 rootme
=`pwd`/ ; export rootme
; \
291 if
[ x
$(enable_version_specific_runtime_libs
) != xyes
]; then \
292 INSTALLDIR
=$(libdir); \
294 INSTALLDIR
=$(libsubdir
); \
296 INSTALLLINKDIR
=$(libsubdir
); \
297 if
[ $${INSTALLLINKDIR}$(MULTISUBDIR
) = $${INSTALLDIR}$(MULTISUBDIR
) ]; then \
299 elif
[ x
$(MULTISUBDIR
) = x
]; then \
300 if
[ $(build_alias
) = $(target_alias
) ]; then \
301 RELINSTALLDIR
=..
/..
/..
/; \
303 RELINSTALLDIR
=..
/..
/..
/..
/$(target_alias
)/lib
/; \
306 if
[ $(build_alias
) = $(target_alias
) ]; then \
307 RELINSTALLDIR
=..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR
)/; \
309 RELINSTALLDIR
=..
/..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias
)/lib
$(MULTISUBDIR
)/; \
312 if
[ $(build_alias
) != $(target_alias
) ]; then \
313 case
$$RELINSTALLDIR in \
314 ..
/..
/..
/|..
/..
/..
/..
/) \
315 RELINSTALLDIR
=..
/$${RELINSTALLDIR}$(target_alias
)/lib
/;; \
318 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(SHLINK
) ; \
319 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(ARLINK
) ; \
320 for FILE in
$(LIBS
) ; do \
321 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
322 if
[ $$FILE = $(SHLINK
) ] ; then \
323 if
[ -f
$${INSTALLDIR}/$(MSHLINK
) ]; then \
324 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
325 $(LN_S
) $${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
326 || cp
$${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
328 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
329 $(LN_S
) $${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
330 || cp
$${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
332 elif
[ $$FILE = $(ARLINK
) ] ; then \
333 if
[ -f
$${INSTALLDIR}/$(MARLINK
) ]; then \
334 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
335 $(LN_S
) $${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
336 || cp
$${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
338 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
339 $(LN_S
) $${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE \
340 || cp
$${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
342 elif
[ $$FILE = mshlink
]; then \
343 for FILE in
$(MSHLINK
) ; do \
344 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
345 $(LN_S
) $(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE \
346 || cp
$(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
348 elif
[ $$FILE = marlink
]; then \
349 for FILE in
$(MARLINK
) ; do \
350 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
351 $(LN_S
) $(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE \
352 || cp
$(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
354 elif
[ $$FILE = $(SHLIB
) ]; then \
355 $(INSTALL_PROGRAM
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
356 : On the HP
, shared libraries must be mode
555.
;\
357 chmod
555 $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
359 $(INSTALL_DATA
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
360 $(RANLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
361 chmod a-x
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
364 @rootme
=`pwd`/ ; export rootme
; \
365 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
370 MYCXXFLAGS
= -g
-O2
-Wpointer-arith
-Wnested-externs
-Woverloaded-virtual
-Wbad-function-cast
-Winline
-Wwrite-strings
-pedantic
-Wno-long-long
371 MYCFLAGS
= -g
-O2
-Wpointer-arith
-Wnested-externs
380 $(MAKE
) -C ..
/libio c
++clean
381 touch ..
/..
/gcc
/libgcc2.ready
384 $(MAKE
) -C ..
/..
/gcc
/ libgcc.a
385 $(MAKE
) CXXFLAGS
="$(MYCXXFLAGS)" CFLAGS
="$(MYCFLAGS)"
387 -$(MAKE
) -C ..
/libio
check
388 -$(MAKE
) -C ..
/..
/gcc check-g
++