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`
93 ln
-s
$(ARLIB
) $(ARLINK
)
96 @
$(MAKE
) $(MARLINK
) "ARLINK=$(MARLINK)"
99 $(CC
) $(LIBCXXFLAGS
) $(SHFLAGS
) -shared
-o
$(SHLIB
) `cat piclist` $(SHDEPS
)
103 $(AR
) $(AR_FLAGS
) t
$(SHARLIB
) $(SHLIB
)
104 mv t
$(SHARLIB
) $(SHARLIB
)
109 ln
-s
$(SHLIB
) $(SHLINK
)
112 @
$(MAKE
) $(MSHLINK
) "SHLINK=$(MSHLINK)"
114 $(IO_DIR
)/iostream.list
: force
115 cd
$(IO_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) iostream.list
117 $(LIBIBERTY_DIR
)/libiberty.a
:
118 cd
$(LIBIBERTY_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
)
120 STRFUNCS
= REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
121 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
122 LESS LEPS LESP GESS GEPS GESP
123 STRIO
= EXTRACT INSERT GETLINE
125 # These are here for SunOS VPATH.
126 cstringi.o
: cstringi.
cc
127 cstdlibi.o
: cstdlibi.
cc
129 stdexcepti.o
: stdexcepti.
cc
130 stlinst.o
: stlinst.
cc
132 # Later do wide strings, too.
133 stmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
134 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
135 for name in
$(STRFUNCS
) $(STRIO
); do \
137 if
[ x
"$(enable_shared)" = xyes
]; then \
138 $(COMPILE.
cc) $(PICFLAG
) -DC
-D
$${name} ${srcdir}/sinst.
cc \
139 -o pic
/c
$${name}.o
; \
141 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
142 $(COMPILE.
cc) -DC
-D
$${name} ${srcdir}/sinst.
cc -o c
$${name}.o
; \
143 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
147 bigstmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
148 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
150 if
[ x
"$(enable_shared)" = xyes
]; then \
151 $(COMPILE.
cc) $(PICFLAG
) -DC \
152 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
153 $(srcdir)/sinst.
cc -o pic
/cstrmain.o
; \
155 $(COMPILE.
cc) -DC
`for N in $(STRFUNCS); do echo " -D$${N}"; done` \
156 $(srcdir)/sinst.
cc -o cstrmain.o
158 if
[ x
"$(enable_shared)" = xyes
]; then \
159 $(COMPILE.
cc) $(PICFLAG
) -DC \
160 `for N in $(STRIO); do echo " -D$${N}"; done` \
161 $(srcdir)/sinst.
cc -o pic
/cstrio.o
; \
163 $(COMPILE.
cc) -DC
`for N in $(STRIO); do echo " -D$${N}"; done` \
164 $(srcdir)/sinst.
cc -o cstrio.o
167 COMFUNCS
= MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
168 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
169 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
170 COMIO
= EXTRACT INSERT
172 stmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
173 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
174 ${srcdir}/std
/ldcomplex.h
175 for N in
$(COMFUNCS
) $(COMIO
); do \
177 if
[ x
"$(enable_shared)" = xyes
]; then \
178 $(COMPILE.
cc) $(PICFLAG
) -DF
-D
$${N} $(srcdir)/cinst.
cc \
181 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
182 $(COMPILE.
cc) -DF
-D
$${N} ${srcdir}/cinst.
cc -o f
$${N}.o
; \
183 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
185 if
[ x
"$(enable_shared)" = xyes
]; then \
186 $(COMPILE.
cc) $(PICFLAG
) -DD
-D
$${N} $(srcdir)/cinst.
cc \
189 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
190 $(COMPILE.
cc) -DD
-D
$${N} ${srcdir}/cinst.
cc -o d
$${N}.o
; \
191 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
193 if
[ x
"$(enable_shared)" = xyes
]; then \
194 $(COMPILE.
cc) $(PICFLAG
) -DLD
-D
$${N} $(srcdir)/cinst.
cc \
197 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
198 $(COMPILE.
cc) -DLD
-D
$${N} ${srcdir}/cinst.
cc -o
ld$${N}.o
; \
199 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
203 bigstmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
204 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
205 ${srcdir}/std
/ldcomplex.h
207 if
[ x
"$(enable_shared)" = xyes
]; then \
208 $(COMPILE.
cc) $(PICFLAG
) -DF \
209 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
210 $(srcdir)/cinst.
cc -o pic
/fcomplex.o
; \
212 $(COMPILE.
cc) -DF
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
213 $(srcdir)/cinst.
cc -o fcomplex.o
215 if
[ x
"$(enable_shared)" = xyes
]; then \
216 $(COMPILE.
cc) $(PICFLAG
) -DF \
217 `for N in $(COMIO); do echo " -D$${N}"; done` \
218 $(srcdir)/cinst.
cc -o pic
/fcomio.o
; \
220 $(COMPILE.
cc) -DF
`for N in $(COMIO); do echo " -D$${N}"; done` \
221 $(srcdir)/cinst.
cc -o fcomio.o
223 if
[ x
"$(enable_shared)" = xyes
]; then \
224 $(COMPILE.
cc) $(PICFLAG
) -DD \
225 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
226 $(srcdir)/cinst.
cc -o pic
/dcomplex.o
; \
228 $(COMPILE.
cc) -DD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
229 $(srcdir)/cinst.
cc -o dcomplex.o
231 if
[ x
"$(enable_shared)" = xyes
]; then \
232 $(COMPILE.
cc) $(PICFLAG
) -DD \
233 `for N in $(COMIO); do echo " -D$${N}"; done` \
234 $(srcdir)/cinst.
cc -o pic
/dcomio.o
; \
236 $(COMPILE.
cc) -DD
`for N in $(COMIO); do echo " -D$${N}"; done` \
237 $(srcdir)/cinst.
cc -o dcomio.o
239 if
[ x
"$(enable_shared)" = xyes
]; then \
240 $(COMPILE.
cc) $(PICFLAG
) -DLD \
241 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
242 $(srcdir)/cinst.
cc -o pic
/ldcomplex.o
; \
244 $(COMPILE.
cc) -DLD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
245 $(srcdir)/cinst.
cc -o ldcomplex.o
247 if
[ x
"$(enable_shared)" = xyes
]; then \
248 $(COMPILE.
cc) $(PICFLAG
) -DLD \
249 `for N in $(COMIO); do echo " -D$${N}"; done` \
250 $(srcdir)/cinst.
cc -o pic
/ldcomio.o
; \
252 $(COMPILE.
cc) -DLD
`for N in $(COMIO); do echo " -D$${N}"; done` \
253 $(srcdir)/cinst.
cc -o ldcomio.o
258 rootme
=`pwd`/ ; export rootme
; \
259 if
[ -z
"$(MULTISUBDIR)" ]; then \
261 for FILE in
$(HEADERS
); do \
262 rm -f
$(gxx_include_dir
)/$$FILE ; \
263 if
[ -f stl
/$$FILE ]; then \
264 $(INSTALL_DATA
) stl
/$$FILE $(gxx_include_dir
)/$$FILE ; \
266 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
268 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
270 for FILE in
*.h std
/*.
*; do \
271 rm -f
$(gxx_include_dir
)/$$FILE ; \
272 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
273 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
276 for FILE in
*.h
; do \
277 rm -f
$(gxx_include_dir
)/$$FILE ; \
278 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
279 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
283 rootme
=`pwd`/ ; export rootme
; \
284 if
[ x
$(enable_version_specific_runtime_libs
) != xyes
]; then \
285 INSTALLDIR
=$(libdir); \
287 INSTALLDIR
=$(libsubdir
); \
289 INSTALLLINKDIR
=$(libsubdir
); \
290 if
[ $${INSTALLLINKDIR}$(MULTISUBDIR
) = $${INSTALLDIR}$(MULTISUBDIR
) ]; then \
292 elif
[ x
$(MULTISUBDIR
) = x
]; then \
293 if
[ $(build_alias
) = $(target_alias
) ]; then \
294 RELINSTALLDIR
=..
/..
/..
/; \
296 RELINSTALLDIR
=..
/..
/..
/..
/$(target_alias
)/lib
/; \
299 if
[ $(build_alias
) = $(target_alias
) ]; then \
300 RELINSTALLDIR
=..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR
)/; \
302 RELINSTALLDIR
=..
/..
/..
/..
`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias
)/lib
$(MULTISUBDIR
)/; \
305 if
[ $(build_alias
) != $(target_alias
) ]; then \
306 case
$$RELINSTALLDIR in \
307 ..
/..
/..
/|..
/..
/..
/..
/) \
308 RELINSTALLDIR
=..
/$${RELINSTALLDIR}$(target_alias
)/lib
/;; \
311 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(SHLINK
) ; \
312 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$(ARLINK
) ; \
313 for FILE in
$(LIBS
) ; do \
314 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
315 if
[ $$FILE = $(SHLINK
) ] ; then \
316 if
[ -f
$${INSTALLDIR}/$(MSHLINK
) ]; then \
317 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
318 ln
-s
$${RELINSTALLDIR}$(MSHLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
320 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
321 ln
-s
$${RELINSTALLDIR}$(SHLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
323 elif
[ $$FILE = $(ARLINK
) ] ; then \
324 if
[ -f
$${INSTALLDIR}/$(MARLINK
) ]; then \
325 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
326 ln
-s
$${RELINSTALLDIR}$(MARLINK
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
328 rm -f
$${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
329 ln
-s
$${RELINSTALLDIR}$(ARLIB
) $${INSTALLLINKDIR}$(MULTISUBDIR
)/$$FILE ; \
331 elif
[ $$FILE = mshlink
]; then \
332 for FILE in
$(MSHLINK
) ; do \
333 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
334 ln
-s
$(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
336 elif
[ $$FILE = marlink
]; then \
337 for FILE in
$(MARLINK
) ; do \
338 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
339 ln
-s
$(ARLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
341 elif
[ $$FILE = $(SHLIB
) ]; then \
342 $(INSTALL_PROGRAM
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
343 : On the HP
, shared libraries must be mode
555.
;\
344 chmod
555 $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
346 $(INSTALL_DATA
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
347 $(RANLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
348 chmod a-x
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
351 @rootme
=`pwd`/ ; export rootme
; \
352 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
357 # Remove these for public releases.
358 MYCXXFLAGS
= -g
-O2
-Wpointer-arith
-Wnested-externs
-Woverloaded-virtual
-Wbad-function-cast
-Winline
-Wwrite-strings
359 MYCFLAGS
= -g
-O2
-Wpointer-arith
-Wnested-externs
368 $(MAKE
) -C ..
/libio c
++clean
369 touch ..
/..
/gcc
/libgcc2.ready
372 -$(MAKE
) -C ..
/..
/gcc
/ libgcc.a
373 -$(MAKE
) check CXXFLAGS
="$(MYCXXFLAGS)" CFLAGS
="$(MYCFLAGS)"
374 -$(MAKE
) -C ..
/libio
check
375 -$(MAKE
) -C ..
/..
/gcc check-g
++