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 # This is where the libraries will be installed; note, it will be set
52 # at make runtime now. See below at target install.
53 INSTALLDIR
= $(libdir)
55 MOSTLYCLEAN_JUNK
= *stmp-
* tlib
*.a
*.s
*.ii stdlist piclist
61 stdlist
: $(IO_DIR
)/iostream.list
$(OBJS
) $(SUBLIBS
) $(LIBIBERTY_DIR
)/libiberty.a
65 for f in
`cat $(IO_DIR)/iostream.list` ; do \
66 echo
"$(IO_DIR)/$$f" >> tlist
; \
68 for f in
$(LIBIBERTY_OBJS
) ; do \
69 echo
"$(LIBIBERTY_DIR)/$$f" >> tlist
; \
76 if
[ x
"$(enable_shared)" = xyes
]; then \
77 sed
's,\([A-Za-z_]*\.o\),pic/\1,g' tlist
> tlist2
; \
84 $(AR
) $(AR_FLAGS
) t
$(ARLIB
) `cat stdlist`
89 $(CC
) $(LIBCXXFLAGS
) $(SHFLAGS
) -shared
-o
$(SHLIB
) `cat piclist` $(SHDEPS
)
93 $(AR
) $(AR_FLAGS
) t
$(SHARLIB
) $(SHLIB
)
94 mv t
$(SHARLIB
) $(SHARLIB
)
98 ln
-f
-s
$(SHLIB
) $(SHLINK
)
101 @
$(MAKE
) $(MSHLINK
) "SHLINK=$(MSHLINK)"
103 $(IO_DIR
)/iostream.list
: force
104 cd
$(IO_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
) iostream.list
106 $(LIBIBERTY_DIR
)/libiberty.a
:
107 cd
$(LIBIBERTY_DIR
) ; $(MAKE
) $(FLAGS_TO_PASS
)
109 STRFUNCS
= REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
110 EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
111 LESS LEPS LESP GESS GEPS GESP
112 STRIO
= EXTRACT INSERT GETLINE
114 # These are here for SunOS VPATH.
115 cstringi.o
: cstringi.
cc
116 cstdlibi.o
: cstdlibi.
cc
118 stdexcepti.o
: stdexcepti.
cc
119 stlinst.o
: stlinst.
cc
121 # Later do wide strings, too.
122 stmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
123 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
124 for name in
$(STRFUNCS
) $(STRIO
); do \
126 if
[ x
"$(enable_shared)" = xyes
]; then \
127 $(COMPILE.
cc) $(PICFLAG
) -DC
-D
$${name} ${srcdir}/sinst.
cc \
128 -o pic
/c
$${name}.o
; \
130 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
131 $(COMPILE.
cc) -DC
-D
$${name} ${srcdir}/sinst.
cc -o c
$${name}.o
; \
132 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
136 bigstmp-string
: ${srcdir}/sinst.
cc ${srcdir}/std
/bastring.h \
137 ${srcdir}/std
/bastring.
cc ${srcdir}/std
/straits.h
139 if
[ x
"$(enable_shared)" = xyes
]; then \
140 $(COMPILE.
cc) $(PICFLAG
) -DC \
141 `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
142 $(srcdir)/sinst.
cc -o pic
/cstrmain.o
; \
144 $(COMPILE.
cc) -DC
`for N in $(STRFUNCS); do echo " -D$${N}"; done` \
145 $(srcdir)/sinst.
cc -o cstrmain.o
147 if
[ x
"$(enable_shared)" = xyes
]; then \
148 $(COMPILE.
cc) $(PICFLAG
) -DC \
149 `for N in $(STRIO); do echo " -D$${N}"; done` \
150 $(srcdir)/sinst.
cc -o pic
/cstrio.o
; \
152 $(COMPILE.
cc) -DC
`for N in $(STRIO); do echo " -D$${N}"; done` \
153 $(srcdir)/sinst.
cc -o cstrio.o
156 COMFUNCS
= MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
157 DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
158 CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
159 COMIO
= EXTRACT INSERT
161 stmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
162 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
163 ${srcdir}/std
/ldcomplex.h
164 for N in
$(COMFUNCS
) $(COMIO
); do \
166 if
[ x
"$(enable_shared)" = xyes
]; then \
167 $(COMPILE.
cc) $(PICFLAG
) -DF
-D
$${N} $(srcdir)/cinst.
cc \
170 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
171 $(COMPILE.
cc) -DF
-D
$${N} ${srcdir}/cinst.
cc -o f
$${N}.o
; \
172 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
174 if
[ x
"$(enable_shared)" = xyes
]; then \
175 $(COMPILE.
cc) $(PICFLAG
) -DD
-D
$${N} $(srcdir)/cinst.
cc \
178 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
179 $(COMPILE.
cc) -DD
-D
$${N} ${srcdir}/cinst.
cc -o d
$${N}.o
; \
180 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
182 if
[ x
"$(enable_shared)" = xyes
]; then \
183 $(COMPILE.
cc) $(PICFLAG
) -DLD
-D
$${N} $(srcdir)/cinst.
cc \
186 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
187 $(COMPILE.
cc) -DLD
-D
$${N} ${srcdir}/cinst.
cc -o
ld$${N}.o
; \
188 if
[ $$?
-eq
0 ]; then true
; else exit
1; fi
; \
192 bigstmp-complx
: ${srcdir}/cinst.
cc ${srcdir}/std
/complext.h \
193 ${srcdir}/std
/complext.
cc ${srcdir}/std
/dcomplex.h \
194 ${srcdir}/std
/ldcomplex.h
196 if
[ x
"$(enable_shared)" = xyes
]; then \
197 $(COMPILE.
cc) $(PICFLAG
) -DF \
198 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
199 $(srcdir)/cinst.
cc -o pic
/fcomplex.o
; \
201 $(COMPILE.
cc) -DF
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
202 $(srcdir)/cinst.
cc -o fcomplex.o
204 if
[ x
"$(enable_shared)" = xyes
]; then \
205 $(COMPILE.
cc) $(PICFLAG
) -DF \
206 `for N in $(COMIO); do echo " -D$${N}"; done` \
207 $(srcdir)/cinst.
cc -o pic
/fcomio.o
; \
209 $(COMPILE.
cc) -DF
`for N in $(COMIO); do echo " -D$${N}"; done` \
210 $(srcdir)/cinst.
cc -o fcomio.o
212 if
[ x
"$(enable_shared)" = xyes
]; then \
213 $(COMPILE.
cc) $(PICFLAG
) -DD \
214 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
215 $(srcdir)/cinst.
cc -o pic
/dcomplex.o
; \
217 $(COMPILE.
cc) -DD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
218 $(srcdir)/cinst.
cc -o dcomplex.o
220 if
[ x
"$(enable_shared)" = xyes
]; then \
221 $(COMPILE.
cc) $(PICFLAG
) -DD \
222 `for N in $(COMIO); do echo " -D$${N}"; done` \
223 $(srcdir)/cinst.
cc -o pic
/dcomio.o
; \
225 $(COMPILE.
cc) -DD
`for N in $(COMIO); do echo " -D$${N}"; done` \
226 $(srcdir)/cinst.
cc -o dcomio.o
228 if
[ x
"$(enable_shared)" = xyes
]; then \
229 $(COMPILE.
cc) $(PICFLAG
) -DLD \
230 `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
231 $(srcdir)/cinst.
cc -o pic
/ldcomplex.o
; \
233 $(COMPILE.
cc) -DLD
`for N in $(COMFUNCS); do echo " -D$${N}"; done` \
234 $(srcdir)/cinst.
cc -o ldcomplex.o
236 if
[ x
"$(enable_shared)" = xyes
]; then \
237 $(COMPILE.
cc) $(PICFLAG
) -DLD \
238 `for N in $(COMIO); do echo " -D$${N}"; done` \
239 $(srcdir)/cinst.
cc -o pic
/ldcomio.o
; \
241 $(COMPILE.
cc) -DLD
`for N in $(COMIO); do echo " -D$${N}"; done` \
242 $(srcdir)/cinst.
cc -o ldcomio.o
247 rootme
=`pwd`/ ; export rootme
; \
248 if
[ -z
"$(MULTISUBDIR)" ]; then \
250 for FILE in
$(HEADERS
); do \
251 rm -f
$(gxx_include_dir
)/$$FILE ; \
252 if
[ -f stl
/$$FILE ]; then \
253 $(INSTALL_DATA
) stl
/$$FILE $(gxx_include_dir
)/$$FILE ; \
255 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
257 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
259 for FILE in
*.h std
/*.
*; do \
260 rm -f
$(gxx_include_dir
)/$$FILE ; \
261 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
262 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
265 for FILE in
*.h
; do \
266 rm -f
$(gxx_include_dir
)/$$FILE ; \
267 $(INSTALL_DATA
) $$FILE $(gxx_include_dir
)/$$FILE ; \
268 chmod a-x
$(gxx_include_dir
)/$$FILE ; \
272 rootme
=`pwd`/ ; export rootme
; \
273 if
[ x
$(libsubdir
) = x
] ||
[ x
$(enable_version_specific_runtime_libs
) != xyes
]; then \
274 INSTALLDIR
=$(libdir); \
276 INSTALLDIR
=$(libsubdir
); \
278 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$(SHLINK
) ; \
279 for FILE in
$(LIBS
) ; do \
280 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
281 if
[ $$FILE = $(SHLINK
) ] ; then \
282 ln
-f
-s
$(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
283 elif
[ $$FILE = mshlink
]; then \
284 for FILE in
$(MSHLINK
) ; do \
285 rm -f
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
286 ln
-f
-s
$(SHLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
288 elif
[ $$FILE = $(SHLIB
) ]; then \
289 $(INSTALL_PROGRAM
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
290 : On the HP
, shared libraries must be mode
555.
;\
291 chmod
555 $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
293 $(INSTALL_DATA
) $$FILE $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
294 $(RANLIB
) $${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
295 chmod a-x
$${INSTALLDIR}$(MULTISUBDIR
)/$$FILE ; \
298 @rootme
=`pwd`/ ; export rootme
; \
299 $(MULTIDO
) $(FLAGS_TO_PASS
) multi-do DO
=install
304 # Remove these for public releases.
305 MYCXXFLAGS
= -g
-O2
-Wpointer-arith
-Wnested-externs
-Woverloaded-virtual
-Wbad-function-cast
-Winline
-Wwrite-strings
306 MYCFLAGS
= -g
-O2
-Wpointer-arith
-Wnested-externs
315 $(MAKE
) -C ..
/libio c
++clean
316 touch ..
/..
/gcc
/libgcc2.ready
319 -$(MAKE
) -C ..
/..
/gcc
/ libgcc.a
320 -$(MAKE
) check CXXFLAGS
="$(MYCXXFLAGS)" CFLAGS
="$(MYCFLAGS)"
321 -$(MAKE
) -C ..
/libio
check
322 -$(MAKE
) -C ..
/..
/gcc check-g
++