Improve --help support.
[official-gcc.git] / libstdc++ / Makefile.in
blob77e2ec931b268e81eedeaa9dbbb57aafc4533ca2
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.
17 VERSION = 2.9.0
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
30 ARLIB = libstdc++.a
31 SHLIB = libstdc++.so.$(VERSION)
32 SHARLIB = libstdc++-sh.a
33 SHLINK = libstdc++.so
34 MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
35 SHFLAGS =
36 SHDEPS =
38 STAMP = bigstmp
40 LIBS = $(ARLIB)
42 #### package, host, target, and site dependent Makefile fragments come in here.
45 IO_DIR = ../libio
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
56 CLEAN_JUNK = $(LIBS)
58 .PHONY: libs
59 libs: $(LIBS)
61 stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
62 -rm -f tlist
63 touch tlist
64 echo *.o >> tlist
65 for f in `cat $(IO_DIR)/iostream.list` ; do \
66 echo "$(IO_DIR)/$$f" >> tlist ; \
67 done
68 for f in $(LIBIBERTY_OBJS) ; do \
69 echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
70 done
71 mv tlist stdlist
73 piclist: stdlist
74 -rm -f tlist
75 cp stdlist tlist
76 if [ x"$(enable_shared)" = xyes ]; then \
77 sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
78 mv tlist2 tlist ; \
79 else true ; fi
80 mv tlist piclist
82 $(ARLIB): stdlist
83 -rm -f t$(ARLIB)
84 $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
85 mv t$(ARLIB) $(ARLIB)
86 $(RANLIB) $(ARLIB)
88 $(SHLIB): piclist
89 $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
91 $(SHARLIB): $(SHLIB)
92 -rm -f t$(SHARLIB)
93 $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
94 mv t$(SHARLIB) $(SHARLIB)
95 $(RANLIB) $(SHARLIB)
97 $(SHLINK):
98 ln -f -s $(SHLIB) $(SHLINK)
100 mshlink:
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
117 cmathi.o: cmathi.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 \
125 echo c$${name}; \
126 if [ x"$(enable_shared)" = xyes ]; then \
127 $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
128 -o pic/c$${name}.o; \
129 else true ; fi; \
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; \
133 done
134 touch stmp-string
136 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
137 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
138 echo cstring
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; \
143 else true ; fi
144 $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
145 $(srcdir)/sinst.cc -o cstrmain.o
146 echo cstrio
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; \
151 else true ; fi
152 $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
153 $(srcdir)/sinst.cc -o cstrio.o
154 touch bigstmp-string
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 \
165 echo f$${N}; \
166 if [ x"$(enable_shared)" = xyes ]; then \
167 $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
168 -o pic/f$${N}.o; \
169 else true ; fi; \
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; \
173 echo d$${N}; \
174 if [ x"$(enable_shared)" = xyes ]; then \
175 $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
176 -o pic/d$${N}.o; \
177 else true ; fi; \
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; \
181 echo ld$${N}; \
182 if [ x"$(enable_shared)" = xyes ]; then \
183 $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
184 -o pic/ld$${N}.o; \
185 else true ; fi; \
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; \
189 done
190 touch stmp-complx
192 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
193 ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
194 ${srcdir}/std/ldcomplex.h
195 echo fcomplex
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; \
200 else true ; fi
201 $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
202 $(srcdir)/cinst.cc -o fcomplex.o
203 echo fcomio
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; \
208 else true ; fi
209 $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
210 $(srcdir)/cinst.cc -o fcomio.o
211 echo dcomplex
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; \
216 else true ; fi
217 $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
218 $(srcdir)/cinst.cc -o dcomplex.o
219 echo dcomio
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; \
224 else true ; fi
225 $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
226 $(srcdir)/cinst.cc -o dcomio.o
227 echo ldcomplex
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; \
232 else true ; fi
233 $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
234 $(srcdir)/cinst.cc -o ldcomplex.o
235 echo ldcomio
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; \
240 else true ; fi
241 $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
242 $(srcdir)/cinst.cc -o ldcomio.o
243 touch bigstmp-complx
245 .PHONY: install
246 install:
247 rootme=`pwd`/ ; export rootme ; \
248 if [ -z "$(MULTISUBDIR)" ]; then \
249 cd $(srcdir); \
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 ; \
254 else \
255 $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
256 fi ; \
257 chmod a-x $(gxx_include_dir)/$$FILE ; \
258 done ; \
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 ; \
263 done ; \
264 cd stl; \
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 ; \
269 done ; \
270 else true ; \
272 rootme=`pwd`/ ; export rootme ; \
273 if [ x$(libsubdir) = x ] || [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
274 INSTALLDIR=$(libdir); \
275 else \
276 INSTALLDIR=$(libsubdir); \
277 fi; \
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 ; \
287 done; \
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 ; \
292 else \
293 $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
294 $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
295 chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
296 fi ; \
297 done
298 @rootme=`pwd`/ ; export rootme ; \
299 $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
301 .PHONY: force
302 force:
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
308 .PHONY: stuff
309 stuff:
310 $(MAKE) stuff1
311 $(MAKE) stuff2
313 stuff1:
314 $(MAKE) clean
315 $(MAKE) -C ../libio c++clean
316 touch ../../gcc/libgcc2.ready
318 stuff2:
319 -$(MAKE) -C ../../gcc/ libgcc.a
320 -$(MAKE) check CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
321 -$(MAKE) -C ../libio check
322 -$(MAKE) -C ../../gcc check-g++