OSDN Git Service

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