Makefile.in revision 51920
167761Smsmith# Copyright (C) 1994, 1995 Free Software Foundation
2172313Snjl
367761Smsmith# This file is part of the GNU ANSI C++ Library.  This library is free
467761Smsmith# software; you can redistribute it and/or modify it under the terms of
567761Smsmith# the GNU General Public License as published by the Free Software
667761Smsmith# Foundation; either version 2, or (at your option) any later version.
767761Smsmith
867761Smsmith# This library is distributed in the hope that it will be useful,
967761Smsmith# but WITHOUT ANY WARRANTY; without even the implied warranty of
1067761Smsmith# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1167761Smsmith# GNU General Public License for more details.
1267761Smsmith
1367761Smsmith# You should have received a copy of the GNU General Public License
1467761Smsmith# along with this library; see the file COPYING.  If not, write to the Free
1567761Smsmith# Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
1667761Smsmith
1767761SmsmithVERSION = 2.9.0
1867761Smsmith
1967761SmsmithOBJS  = cstringi.o stdexcepti.o cstdlibi.o cmathi.o stlinst.o
2067761SmsmithSUBLIBS = $(STAMP)-string $(STAMP)-complx
2167761Smsmith
2267761Smsmith# C++ headers with no extension
2367761SmsmithHEADERS= cassert cctype cerrno cfloat ciso646 climits clocale cmath complex \
2467761Smsmith	 csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime \
2567761Smsmith	 cwchar cwctype string stdexcept \
2667761Smsmith	 algorithm deque functional hash_map hash_set iterator list map \
2767761Smsmith	 memory numeric pthread_alloc queue rope set slist stack utility \
2867761Smsmith	 vector fstream iomanip iostream strstream iosfwd
29119418Sobrien
30119418SobrienARLIB   = libstdc++.a
31119418SobrienSHLIB   = libstdc++.so.$(VERSION)
3267761SmsmithSHARLIB = libstdc++-sh.a
3367761SmsmithSHLINK  = libstdc++.so
3467761SmsmithMSHLINK = libstdc++.so.`echo $(VERSION) | sed 's/\([0-9][.][0-9]\).*/\1/'`
3567761SmsmithSHFLAGS = 
36168191SjhbSHDEPS  =
37129197Snjl
38131384SnjlSTAMP   = bigstmp
39131384Snjl
4067761SmsmithLIBS    = $(ARLIB)
4167761Smsmith
4267761Smsmith#### package, host, target, and site dependent Makefile fragments come in here.
4367761Smsmith##
4467761Smsmith
45193530SjkimIO_DIR    = ../libio
46193530SjkimLIBIBERTY_DIR = ../libiberty
47193530Sjkim
4867761SmsmithLIBIBERTY_OBJS = `cat $(LIBIBERTY_DIR)/needed-list` strerror.o
4967761Smsmith
50133617Snjltooldir = $(exec_prefix)/$(target)
5178992Smsmith# This is where the libraries will be installed; note, it will be set
5291122Smsmith# at make runtime now. See below at target install.
5369744SmsmithINSTALLDIR = $(libdir)
5480069Smsmith
5580069SmsmithMOSTLYCLEAN_JUNK = *stmp-* tlib*.a *.s *.ii stdlist piclist
5680069SmsmithCLEAN_JUNK = $(LIBS)
5780069Smsmith
5880069Smsmith.PHONY: libs
5980069Smsmithlibs: $(LIBS)
6080069Smsmith
6180069Smsmithstdlist: $(IO_DIR)/iostream.list $(OBJS) $(SUBLIBS) $(LIBIBERTY_DIR)/libiberty.a
6280069Smsmith	-rm -f tlist
6380069Smsmith	touch tlist
6480069Smsmith	echo *.o >> tlist
6580069Smsmith	for f in `cat $(IO_DIR)/iostream.list` ; do \
6680069Smsmith	  echo "$(IO_DIR)/$$f" >> tlist ; \
67172313Snjl	done
6880069Smsmith	for f in $(LIBIBERTY_OBJS) ; do \
6980069Smsmith	  echo "$(LIBIBERTY_DIR)/$$f" >> tlist ; \
7080069Smsmith	done
7180069Smsmith	mv tlist stdlist
7280069Smsmith
7380069Smsmithpiclist: stdlist
74139339Snjl	-rm -f tlist
7580069Smsmith	cp stdlist tlist
7680069Smsmith	if [ x"$(enable_shared)" = xyes ]; then \
7780069Smsmith	  sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
7880069Smsmith	  mv tlist2 tlist ; \
7980069Smsmith	else true ; fi
8080069Smsmith	mv tlist piclist
8180069Smsmith
8280069Smsmith$(ARLIB): stdlist
8380069Smsmith	-rm -f t$(ARLIB)
84167044Snjl	$(AR) $(AR_FLAGS) t$(ARLIB) `cat stdlist`
8580069Smsmith	mv t$(ARLIB) $(ARLIB)
8680069Smsmith	$(RANLIB) $(ARLIB)
8780069Smsmith
8880069Smsmith$(SHLIB): piclist
8980069Smsmith	$(CC) $(LIBCXXFLAGS) $(SHFLAGS) -shared -o $(SHLIB) `cat piclist` $(SHDEPS)
9080069Smsmith
91167044Snjl$(SHARLIB): $(SHLIB)
9280069Smsmith	-rm -f t$(SHARLIB)
9380069Smsmith	$(AR) $(AR_FLAGS) t$(SHARLIB) $(SHLIB)
9480069Smsmith	mv t$(SHARLIB) $(SHARLIB)
9580069Smsmith	$(RANLIB) $(SHARLIB)
9680069Smsmith
9780069Smsmith$(SHLINK):
9880069Smsmith	ln -f -s $(SHLIB) $(SHLINK)
9980069Smsmith
10080069Smsmithmshlink:
10180069Smsmith	@$(MAKE) $(MSHLINK) "SHLINK=$(MSHLINK)"
10280069Smsmith
10380069Smsmith$(IO_DIR)/iostream.list: force
104167044Snjl	cd $(IO_DIR) ; $(MAKE) $(FLAGS_TO_PASS) iostream.list
10580069Smsmith
106167044Snjl$(LIBIBERTY_DIR)/libiberty.a:
107167044Snjl	cd $(LIBIBERTY_DIR) ; $(MAKE) $(FLAGS_TO_PASS)
108167044Snjl
10980069SmsmithSTRFUNCS = REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC \
11080069Smsmith	   EQSS EQPS EQSP NESS NEPS NESP LTSS LTPS LTSP GTSS GTPS GTSP \
11180069Smsmith	   LESS LEPS LESP GESS GEPS GESP
11280069SmsmithSTRIO	 = EXTRACT INSERT GETLINE
11380069Smsmith
11480069Smsmith# These are here for SunOS VPATH.
11580069Smsmithcstringi.o: cstringi.cc
11680069Smsmithcstdlibi.o: cstdlibi.cc
11780069Smsmithcmathi.o: cmathi.cc
11880069Smsmithstdexcepti.o: stdexcepti.cc
11980069Smsmithstlinst.o: stlinst.cc
12080069Smsmith
12180069Smsmith# Later do wide strings, too.
12280069Smsmithstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
12380069Smsmith	     ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
124129197Snjl	for name in $(STRFUNCS) $(STRIO); do \
125129197Snjl	  echo c$${name}; \
126129197Snjl	  if [ x"$(enable_shared)" = xyes ]; then \
127129197Snjl	    $(COMPILE.cc) $(PICFLAG) -DC -D$${name} ${srcdir}/sinst.cc \
128129197Snjl	      -o pic/c$${name}.o; \
129129197Snjl	  else true ; fi; \
130129197Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
131129197Snjl	  $(COMPILE.cc) -DC -D$${name} ${srcdir}/sinst.cc -o c$${name}.o; \
13280069Smsmith	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
13380069Smsmith	done
13480069Smsmith	touch stmp-string
13567761Smsmith
13667761Smsmithbigstmp-string: ${srcdir}/sinst.cc ${srcdir}/std/bastring.h \
13767761Smsmith	        ${srcdir}/std/bastring.cc ${srcdir}/std/straits.h
138129197Snjl	echo cstring
139129197Snjl	if [ x"$(enable_shared)" = xyes ]; then \
140117809Snjl	  $(COMPILE.cc) $(PICFLAG) -DC \
141172313Snjl	    `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
14267761Smsmith	    $(srcdir)/sinst.cc -o pic/cstrmain.o; \
14367761Smsmith	else true ; fi
14467761Smsmith	$(COMPILE.cc) -DC `for N in $(STRFUNCS); do echo " -D$${N}"; done` \
14567761Smsmith	  $(srcdir)/sinst.cc -o cstrmain.o
14667761Smsmith	echo cstrio
14767761Smsmith	if [ x"$(enable_shared)" = xyes ]; then \
14867761Smsmith	  $(COMPILE.cc) $(PICFLAG) -DC \
14967761Smsmith	    `for N in $(STRIO); do echo " -D$${N}"; done` \
15067761Smsmith	    $(srcdir)/sinst.cc -o pic/cstrio.o; \
15167761Smsmith	else true ; fi
152117384Snjl	$(COMPILE.cc) -DC `for N in $(STRIO); do echo " -D$${N}"; done` \
153117384Snjl	  $(srcdir)/sinst.cc -o cstrio.o
154167044Snjl	touch bigstmp-string
155167044Snjl
156213737SavgCOMFUNCS = MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC \
157172973Stakawata	   DIVCF DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR \
15867761Smsmith	   CONJ NORM COS COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT
15967761SmsmithCOMIO    = EXTRACT INSERT
160117384Snjl
161133617Snjlstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
162117384Snjl	      ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
163117384Snjl	      ${srcdir}/std/ldcomplex.h
164117384Snjl	for N in $(COMFUNCS) $(COMIO); do \
165117384Snjl	  echo f$${N}; \
166105857Siwasaki	  if [ x"$(enable_shared)" = xyes ]; then \
167167044Snjl	    $(COMPILE.cc) $(PICFLAG) -DF -D$${N} $(srcdir)/cinst.cc \
168213737Savg	      -o pic/f$${N}.o; \
16967761Smsmith	  else true ; fi; \
170167044Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
171172313Snjl	  $(COMPILE.cc) -DF -D$${N} ${srcdir}/cinst.cc -o f$${N}.o; \
172167044Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
173117649Snjl	  echo d$${N}; \
174117649Snjl	  if [ x"$(enable_shared)" = xyes ]; then \
175117649Snjl	    $(COMPILE.cc) $(PICFLAG) -DD -D$${N} $(srcdir)/cinst.cc \
176117649Snjl	      -o pic/d$${N}.o; \
177117649Snjl	  else true ; fi; \
178117649Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
179133617Snjl	  $(COMPILE.cc) -DD -D$${N} ${srcdir}/cinst.cc -o d$${N}.o; \
180133617Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
181227309Sed	  echo ld$${N}; \
182167044Snjl	  if [ x"$(enable_shared)" = xyes ]; then \
183167671Snjl	    $(COMPILE.cc) $(PICFLAG) -DLD -D$${N} $(srcdir)/cinst.cc \
184167044Snjl	      -o pic/ld$${N}.o; \
185167671Snjl	  else true ; fi; \
186167044Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
187172313Snjl	  $(COMPILE.cc) -DLD -D$${N} ${srcdir}/cinst.cc -o ld$${N}.o; \
188172313Snjl	  if [ $$? -eq 0 ]; then true; else exit 1; fi; \
189172313Snjl	done
190172313Snjl	touch stmp-complx
191167044Snjl
192167044Snjlbigstmp-complx: ${srcdir}/cinst.cc ${srcdir}/std/complext.h \
193167044Snjl	         ${srcdir}/std/complext.cc ${srcdir}/std/dcomplex.h \
194167044Snjl	         ${srcdir}/std/ldcomplex.h
195167044Snjl	echo fcomplex
196172313Snjl	if [ x"$(enable_shared)" = xyes ]; then \
197172313Snjl	  $(COMPILE.cc) $(PICFLAG) -DF \
19867761Smsmith	    `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
199133617Snjl	    $(srcdir)/cinst.cc -o pic/fcomplex.o; \
20067761Smsmith	else true ; fi
201170211Snjl	$(COMPILE.cc) -DF `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
202170211Snjl	  $(srcdir)/cinst.cc -o fcomplex.o
203170211Snjl	echo fcomio
204170211Snjl	if [ x"$(enable_shared)" = xyes ]; then \
205170211Snjl	  $(COMPILE.cc) $(PICFLAG) -DF \
206170211Snjl	    `for N in $(COMIO); do echo " -D$${N}"; done` \
207170211Snjl	    $(srcdir)/cinst.cc -o pic/fcomio.o; \
208172313Snjl	else true ; fi
209116927Snjl	$(COMPILE.cc) -DF `for N in $(COMIO); do echo " -D$${N}"; done` \
21067761Smsmith	  $(srcdir)/cinst.cc -o fcomio.o
21167761Smsmith	echo dcomplex
212172313Snjl	if [ x"$(enable_shared)" = xyes ]; then \
21367761Smsmith	  $(COMPILE.cc) $(PICFLAG) -DD \
21467761Smsmith	    `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
215172313Snjl	    $(srcdir)/cinst.cc -o pic/dcomplex.o; \
216170211Snjl	else true ; fi
217170211Snjl	$(COMPILE.cc) -DD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
21867761Smsmith	  $(srcdir)/cinst.cc -o dcomplex.o
21967761Smsmith	echo dcomio
220216471Sjkim	if [ x"$(enable_shared)" = xyes ]; then \
221172313Snjl	  $(COMPILE.cc) $(PICFLAG) -DD \
222116927Snjl	    `for N in $(COMIO); do echo " -D$${N}"; done` \
223116927Snjl	    $(srcdir)/cinst.cc -o pic/dcomio.o; \
224116927Snjl	else true ; fi
225208722Sjkim	$(COMPILE.cc) -DD `for N in $(COMIO); do echo " -D$${N}"; done` \
226116927Snjl	  $(srcdir)/cinst.cc -o dcomio.o
227172313Snjl	echo ldcomplex
228172313Snjl	if [ x"$(enable_shared)" = xyes ]; then \
229117384Snjl	  $(COMPILE.cc) $(PICFLAG) -DLD \
230116927Snjl	    `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
231116927Snjl	    $(srcdir)/cinst.cc -o pic/ldcomplex.o; \
232116927Snjl	else true ; fi
233208722Sjkim	$(COMPILE.cc) -DLD `for N in $(COMFUNCS); do echo " -D$${N}"; done` \
23467761Smsmith	  $(srcdir)/cinst.cc -o ldcomplex.o
23567761Smsmith	echo ldcomio
236172973Stakawata	if [ x"$(enable_shared)" = xyes ]; then \
237172973Stakawata	  $(COMPILE.cc) $(PICFLAG) -DLD \
238131339Snjl	    `for N in $(COMIO); do echo " -D$${N}"; done` \
239143861Snjl	    $(srcdir)/cinst.cc -o pic/ldcomio.o; \
240202771Sjkim	else true ; fi
241143861Snjl	$(COMPILE.cc) -DLD `for N in $(COMIO); do echo " -D$${N}"; done` \
242202771Sjkim	  $(srcdir)/cinst.cc -o ldcomio.o
24367761Smsmith	touch bigstmp-complx
24467761Smsmith
24567761Smsmith.PHONY: install
24667761Smsmithinstall:
24767761Smsmith	rootme=`pwd`/ ; export rootme ; \
248172973Stakawata	if [ -z "$(MULTISUBDIR)" ]; then \
249172973Stakawata	  cd $(srcdir); \
250131339Snjl	  for FILE in $(HEADERS); do \
25167761Smsmith	    rm -f $(gxx_include_dir)/$$FILE ; \
252143861Snjl	    if [ -f stl/$$FILE ]; then \
253143861Snjl	      $(INSTALL_DATA) stl/$$FILE $(gxx_include_dir)/$$FILE ; \
254143861Snjl	    else \
255143861Snjl	      $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
256246128Ssbz	    fi ; \
25767761Smsmith	    chmod a-x $(gxx_include_dir)/$$FILE ; \
25867761Smsmith	  done ; \
25967761Smsmith	  for FILE in *.h std/*.*; do \
26067761Smsmith	    rm -f $(gxx_include_dir)/$$FILE ; \
26167761Smsmith	    $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
26267761Smsmith	    chmod a-x $(gxx_include_dir)/$$FILE ; \
26367761Smsmith	  done ; \
26467761Smsmith	  cd stl; \
26589054Smsmith	  for FILE in *.h; do \
26667761Smsmith	    rm -f $(gxx_include_dir)/$$FILE ; \
267128071Snjl	    $(INSTALL_DATA) $$FILE $(gxx_include_dir)/$$FILE ; \
26867761Smsmith	    chmod a-x $(gxx_include_dir)/$$FILE ; \
26967761Smsmith	  done ; \
270172313Snjl	else true ; \
271117795Snjl	fi
27267761Smsmith	rootme=`pwd`/ ; export rootme ; \
273172313Snjl	if [ x$(libsubdir) = x ] || [ x$(enable_version_specific_runtime_libs) != xyes ]; then \
274172313Snjl	  INSTALLDIR=$(libdir); \
275172313Snjl	else \
27667761Smsmith	  INSTALLDIR=$(libsubdir); \
277117795Snjl	fi; \
278117795Snjl	rm -f $${INSTALLDIR}$(MULTISUBDIR)/$(SHLINK) ; \
27967761Smsmith	for FILE in $(LIBS) ; do \
280117795Snjl	  rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
281117795Snjl	  if [ $$FILE = $(SHLINK) ] ; then \
282117795Snjl	    ln -f -s $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
283117795Snjl	  elif [ $$FILE = mshlink ]; then \
284129197Snjl	    for FILE in $(MSHLINK) ; do \
285117795Snjl	      rm -f $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
28696926Speter	      ln -f -s $(SHLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
28767761Smsmith	    done; \
288117795Snjl	  elif [ $$FILE = $(SHLIB) ]; then \
289167814Sjkim	    $(INSTALL_PROGRAM) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
290117795Snjl	    : On the HP, shared libraries must be mode 555. ;\
291167814Sjkim	    chmod 555 $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
292167814Sjkim	  else \
293117795Snjl	    $(INSTALL_DATA) $$FILE $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
294117795Snjl	    $(RANLIB) $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
295117795Snjl	    chmod a-x $${INSTALLDIR}$(MULTISUBDIR)/$$FILE ; \
296117795Snjl	  fi ; \
297231161Sjkim	done
298117795Snjl	@rootme=`pwd`/ ; export rootme ; \
299129197Snjl	$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
300117795Snjl
301117795Snjl.PHONY: force
302117795Snjlforce:
303117795Snjl
304167814Sjkim# Remove these for public releases.
305117795SnjlMYCXXFLAGS = -g -O2 -Wpointer-arith -Wnested-externs -Woverloaded-virtual -Wbad-function-cast -Winline -Wwrite-strings
306117795SnjlMYCFLAGS = -g -O2 -Wpointer-arith -Wnested-externs
307129197Snjl
308117795Snjl.PHONY: stuff
309117795Snjlstuff:
310117795Snjl	$(MAKE) stuff1
311117795Snjl	$(MAKE) stuff2
312117795Snjl
313167814Sjkimstuff1:
314117795Snjl	$(MAKE) clean
315167814Sjkim	$(MAKE) -C ../libio c++clean
316117795Snjl	touch ../../gcc/libgcc2.ready
317117795Snjl
318117795Snjlstuff2:
319117795Snjl	-$(MAKE) -C ../../gcc/ libgcc.a
320129168Snjl	-$(MAKE) check CXXFLAGS="$(MYCXXFLAGS)" CFLAGS="$(MYCFLAGS)"
321129197Snjl	-$(MAKE) -C ../libio check
322129197Snjl	-$(MAKE) -C ../../gcc check-g++
323129197Snjl