OSDN Git Service

Fix bad consistency checks.
[pf3gnuchains/gcc-fork.git] / libstdc++ / Makefile.in
1 # Copyright (C) 1994, 1995 Free Software Foundation
2
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.
7
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.
12
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.
16
17 VERSION = 2.9.0
18 INTERFACE = 2
19
20 OBJS  = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o
21 SUBLIBS = $(STAMP)-string $(STAMP)-complx
22
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
30
31 ARLIB   = libstdc++.a.$(VERSION)
32 ARLINK  = libstdc++.a
33 MARLINK = libstdc++.a.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
34 SHLIB   = libstdc++.so.$(VERSION)
35 SHARLIB = libstdc++-sh.a
36 SHLINK  = libstdc++.so
37 MSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
38 SHFLAGS = 
39 SHDEPS  =
40
41 STAMP   = bigstmp
42
43 LIBS    = $(ARLIB) $(ARLINK)
44
45 #### package, host, target, and site dependent Makefile fragments come in here.
46 ##
47
48 IO_DIR    = ../libio
49 LIBIBERTY_DIR = ../libiberty
50
51 LIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
52
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)
57
58 MOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
59 CLEAN_JUNK = $(LIBS)
60
61 .PHONY: libs
62 libs: $(LIBS)
63
64 stdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
65         -rm -f tlist
66         touch tlist
67         echo *.o >> tlist
68         for f in `cat $(IO_DIR)/iostream.list` ; do \
69           echo "$(IO_DIR)/$$f" >> tlist ; \
70         done
71         for f in $(LIBIBERTY_OBJS) ; do \
72           echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
73         done
74         mv tlist stdlist
75
76 piclist: stdlist
77         -rm -f tlist
78         cp stdlist tlist
79         if [ x"$(enable_shared)" = xyes ]; then \
80           sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
81           mv tlist2 tlist ; \
82         else true ; fi
83         mv tlist piclist
84
85 $(ARLIB): stdlist
86         -rm -f t$(ARLIB)
87         $(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
88         mv t$(ARLIB) $(ARLIB)
89         $(RANLIB) $(ARLIB)
90
91 $(ARLINK):
92         ln -f -s $(ARLIB) $(ARLINK)
93
94 marlink:
95         @$(MAKE) $(MARLINK) "ARLINK=$(MARLINK)"
96
97 $(SHLIB): piclist
98         $(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
99
100 $(SHARLIB): $(SHLIB)
101         -rm -f t$(SHARLIB)
102         $(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
103         mv t$(SHARLIB) $(SHARLIB)
104         $(RANLIB) $(SHARLIB)
105
106 $(SHLINK):
107         ln -f -s $(SHLIB) $(SHLINK)
108
109 mshlink:
110         @$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
111
112 $(IO_DIR)/iostream.list: force
113         cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
114
115 $(LIBIBERTY_DIR)/libiberty.a:
116         cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
117
118 STRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
119            EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
120            LESS LEPS LESP GESS GEPS GESP
121 STRIO    = EXTRACT INSERT GETLINE
122
123 # These are here for SunOS VPATH.
124 cstringi.o: cstringi.cc
125 cstdlibi.o: cstdlibi.cc
126 cmathi.o: cmathi.cc
127 stdexcepti.o: stdexcepti.cc
128 stlinst.o: stlinst.cc
129
130 # Later do wide strings, too.
131 stmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
132              ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
133         for name in $(STRFUNCS) $(STRIO); do \
134           echo c$${name}; \
135           if [ x"$(enable_shared)" = xyes ]; then \
136             $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
137               -o pic/c$${name}.o; \
138           else true ; fi; \
139           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
140           $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
141           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
142         done
143         touch stmp-string
144
145 bigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
146                 ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
147         echo cstring
148         if [ x"$(enable_shared)" = xyes ]; then \
149           $(COMPILE.cc) $(PICFLAG) -DC \
150             `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
151             $(srcdir)/sinst.cc -o pic/cstrmain.o; \
152         else true ; fi
153         $(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
154           $(srcdir)/sinst.cc -o cstrmain.o
155         echo cstrio
156         if [ x"$(enable_shared)" = xyes ]; then \
157           $(COMPILE.cc) $(PICFLAG) -DC \
158             `for N in $(STRIO); do echo " -D$${N}"; done` \
159             $(srcdir)/sinst.cc -o pic/cstrio.o; \
160         else true ; fi
161         $(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
162           $(srcdir)/sinst.cc -o cstrio.o
163         touch bigstmp-string
164
165 COMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
166            DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
167            CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
168 COMIO    = EXTRACT INSERT
169
170 stmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
171               ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
172               ${srcdir}/std/ldcomplex.h
173         for N in $(COMFUNCS) $(COMIO); do \
174           echo f$${N}; \
175           if [ x"$(enable_shared)" = xyes ]; then \
176             $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
177               -o pic/f$${N}.o; \
178           else true ; fi; \
179           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
180           $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
181           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
182           echo d$${N}; \
183           if [ x"$(enable_shared)" = xyes ]; then \
184             $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
185               -o pic/d$${N}.o; \
186           else true ; fi; \
187           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
188           $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
189           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
190           echo ld$${N}; \
191           if [ x"$(enable_shared)" = xyes ]; then \
192             $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
193               -o pic/ld$${N}.o; \
194           else true ; fi; \
195           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
196           $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
197           if [ $$? -eq 0 ]; then true; else exit 1; fi; \
198         done
199         touch stmp-complx
200
201 bigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
202                  ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
203                  ${srcdir}/std/ldcomplex.h
204         echo fcomplex
205         if [ x"$(enable_shared)" = xyes ]; then \
206           $(COMPILE.cc) $(PICFLAG) -DF \
207             `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
208             $(srcdir)/cinst.cc -o pic/fcomplex.o; \
209         else true ; fi
210         $(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
211           $(srcdir)/cinst.cc -o fcomplex.o
212         echo fcomio
213         if [ x"$(enable_shared)" = xyes ]; then \
214           $(COMPILE.cc) $(PICFLAG) -DF \
215             `for N in $(COMIO); do echo " -D$${N}"; done` \
216             $(srcdir)/cinst.cc -o pic/fcomio.o; \
217         else true ; fi
218         $(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
219           $(srcdir)/cinst.cc -o fcomio.o
220         echo dcomplex
221         if [ x"$(enable_shared)" = xyes ]; then \
222           $(COMPILE.cc) $(PICFLAG) -DD \
223             `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
224             $(srcdir)/cinst.cc -o pic/dcomplex.o; \
225         else true ; fi
226         $(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
227           $(srcdir)/cinst.cc -o dcomplex.o
228         echo dcomio
229         if [ x"$(enable_shared)" = xyes ]; then \
230           $(COMPILE.cc) $(PICFLAG) -DD \
231             `for N in $(COMIO); do echo " -D$${N}"; done` \
232             $(srcdir)/cinst.cc -o pic/dcomio.o; \
233         else true ; fi
234         $(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
235           $(srcdir)/cinst.cc -o dcomio.o
236         echo ldcomplex
237         if [ x"$(enable_shared)" = xyes ]; then \
238           $(COMPILE.cc) $(PICFLAG) -DLD \
239             `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
240             $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
241         else true ; fi
242         $(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
243           $(srcdir)/cinst.cc -o ldcomplex.o
244         echo ldcomio
245         if [ x"$(enable_shared)" = xyes ]; then \
246           $(COMPILE.cc) $(PICFLAG) -DLD \
247             `for N in $(COMIO); do echo " -D$${N}"; done` \
248             $(srcdir)/cinst.cc -o pic/ldcomio.o; \
249         else true ; fi
250         $(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
251           $(srcdir)/cinst.cc -o ldcomio.o
252         touch bigstmp-complx
253
254 .PHONY: install
255 install:
256         rootme=`pwd`/ ; export rootme ; \
257         if [ -z "$(MULTISUBDIR)" ]; then \
258           cd $(srcdir); \
259           for FILE in $(HEADERS); do \
260             rm -f $(gxx_include_dir)/$$FILE ; \
261             if [ -f stl/$$FILE ]; then \
262               $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
263             else \
264               $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
265             fi ; \
266             chmod a-x $(gxx_include_dir)/$$FILE ; \
267           done ; \
268           for FILE in *.h std/*.*; do \
269             rm -f $(gxx_include_dir)/$$FILE ; \
270             $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
271             chmod a-x $(gxx_include_dir)/$$FILE ; \
272           done ; \
273           cd stl; \
274           for FILE in *.h; do \
275             rm -f $(gxx_include_dir)/$$FILE ; \
276             $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
277             chmod a-x $(gxx_include_dir)/$$FILE ; \
278           done ; \
279         else true ; \
280         fi
281         rootme=`pwd`/ ; export rootme ; \
282         if [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
283           INSTALLDIR=$(libdir); \
284         else \
285           INSTALLDIR=$(libsubdir); \
286         fi; \
287         INSTALLLINKDIR=$(libsubdir); \
288         if [ $${INSTALLLINKDIR}$(MULTISUBDIR) = $${INSTALLDIR}$(MULTISUBDIR) ]; then \
289           RELINSTALLDIR=; \
290         elif [ x$(MULTISUBDIR) = x ]; then \
291           if [ $(build_alias) = $(target_alias) ]; then \
292             RELINSTALLDIR=../../../; \
293           else \
294             RELINSTALLDIR=../../../../$(target_alias)/lib/; \
295           fi; \
296         else \
297           if [ $(build_alias) = $(target_alias) ]; then \
298             RELINSTALLDIR=../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`$(MULTISUBDIR)/; \
299           else \
300             RELINSTALLDIR=../../../..`echo $(MULTISUBDIR) | sed -e 's,/[^/]*,/..,g'`/$(target_alias)/lib$(MULTISUBDIR)/; \
301           fi; \
302         fi; \
303         if [ $(build_alias) != $(target_alias) ]; then \
304           case $$RELINSTALLDIR in \
305           ../../../|../../../../) \
306             RELINSTALLDIR=../$${RELINSTALLDIR}$(target_alias)/lib/;; \
307           esac; \
308         fi; \
309         rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(SHLINK) ; \
310         rm -f $${INSTALLLINKDIR}$(MULTISUBDIR)/$(ARLINK) ; \
311         for FILE in $(LIBS) ; do \
312           rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
313           if [ $$FILE = $(SHLINK) ] ; then \
314             if [ -f $${INSTALLDIR}/$(MSHLINK) ]; then \
315               ln -f -s $${RELINSTALLDIR}$(MSHLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
316             else \
317               ln -f -s $${RELINSTALLDIR}$(SHLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
318             fi; \
319           elif [ $$FILE = $(ARLINK) ] ; then \
320             if [ -f $${INSTALLDIR}/$(MARLINK) ]; then \
321               ln -f -s $${RELINSTALLDIR}$(MARLINK) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
322             else \
323               ln -f -s $${RELINSTALLDIR}$(ARLIB) $${INSTALLLINKDIR}$(MULTISUBDIR)/$$FILE ; \
324             fi; \
325           elif [ $$FILE = mshlink ]; then \
326             for FILE in $(MSHLINK) ; do \
327               rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
328               ln -f -s $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
329             done; \
330           elif [ $$FILE = marlink ]; then \
331             for FILE in $(MARLINK) ; do \
332               rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
333               ln -f -s $(ARLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
334             done; \
335           elif [ $$FILE = $(SHLIB) ]; then \
336             $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
337             : On the HP, shared libraries must be mode 555. ;\
338             chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
339           else \
340             $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
341             $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
342             chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
343           fi ; \
344         done
345         @rootme=`pwd`/ ; export rootme ; \
346         $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
347
348 .PHONY: force
349 force:
350
351 # Remove these for public releases.
352 MYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings
353 MYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
354
355 .PHONY: stuff
356 stuff:
357         $(MAKE) stuff1
358         $(MAKE) stuff2
359
360 stuff1:
361         $(MAKE) clean
362         $(MAKE) -C ../libio c++clean
363         touch ../../gcc/libgcc2.ready
364
365 stuff2:
366         -$(MAKE) -C ../../gcc/ libgcc.a
367         -$(MAKE) check CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
368         -$(MAKE) -C ../libio check
369         -$(MAKE) -C ../../gcc check-g++