OSDN Git Service

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