Makefile.am revision 117397
197403Sobrien## Makefile for the src subdirectory of the GNU C++ Standard library.
297403Sobrien##
3117397Skan## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
497403Sobrien## Free Software Foundation, Inc.
597403Sobrien##
697403Sobrien## This file is part of the libstdc++ version 3 distribution.
797403Sobrien## Process this file with automake to produce Makefile.in.
897403Sobrien
997403Sobrien## This file is part of the GNU ISO C++ Library.  This library is free
1097403Sobrien## software; you can redistribute it and/or modify it under the
1197403Sobrien## terms of the GNU General Public License as published by the
1297403Sobrien## Free Software Foundation; either version 2, or (at your option)
1397403Sobrien## any later version.
1497403Sobrien
1597403Sobrien## This library is distributed in the hope that it will be useful,
1697403Sobrien## but WITHOUT ANY WARRANTY; without even the implied warranty of
1797403Sobrien## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1897403Sobrien## GNU General Public License for more details.
1997403Sobrien
2097403Sobrien## You should have received a copy of the GNU General Public License along
2197403Sobrien## with this library; see the file COPYING.  If not, write to the Free
2297403Sobrien## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2397403Sobrien## USA.
2497403Sobrien
25103447SkanAUTOMAKE_OPTIONS = 1.3 cygnus
2697403SobrienMAINT_CHARSET = latin1
2797403Sobrien
2897403Sobrienmkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
2997403Sobrien
30103447Skan# Cross compiler support.
3197403SobrienCXX = @glibcpp_CXX@
32117397Skanglibcpp_srcdir=@glibcpp_srcdir@
33117397Skanglibcpp_builddir=@glibcpp_builddir@
3497403Sobrientoolexecdir = @glibcpp_toolexecdir@
3597403Sobrientoolexeclibdir = @glibcpp_toolexeclibdir@
3697403Sobrientoolexeclib_LTLIBRARIES = libstdc++.la
3797403Sobrien
38117397Skan# Symbol versioning for shared libraries.
39117397Skanif GLIBCPP_BUILD_VERSIONED_SHLIB
40117397Skanversion_arg = -Wl,--version-script=libstdc++-symbol.ver
41117397Skanlibstdc++-symbol.ver:  ${glibcpp_srcdir}/@SYMVER_MAP@
42117397Skan	@LN_S@  ${glibcpp_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver || true
43117397Skanelse
44117397Skanversion_arg =
45117397Skanlibstdc++-symbol.ver:
46117397Skanendif
47117397Skan
4897403Sobrien# Compile flags that should be constant throughout the build, both for
4997403Sobrien# SUBDIRS and for libstdc++-v3 in general.
5097403SobrienOPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
5197403Sobrien
5297403Sobrien# These bits are all figured out from configure. Look in acinclude.m4
5397403Sobrien# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
5497403SobrienCONFIG_CXXFLAGS = \
55117397Skan	@SECTION_FLAGS@ @EXTRA_CXX_FLAGS@ 
5697403Sobrien
5797403Sobrien# Warning flags to use.
5897403SobrienWARN_CXXFLAGS = \
5997403Sobrien	@WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
6097403Sobrien
6197403Sobrien# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
6297403SobrienGLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
6397403SobrienLIBMATH_INCLUDES = @LIBMATH_INCLUDES@
6497403SobrienLIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
6597403SobrienLIBIO_INCLUDES = @LIBIO_INCLUDES@
6697403SobrienTOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
6797403Sobrien
6897403SobrienINCLUDES = \
6997403Sobrien	-nostdinc++ \
7097403Sobrien	$(GLIBCPP_INCLUDES) \
7197403Sobrien	$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
7297403Sobrien	$(TOPLEVEL_INCLUDES)
7397403Sobrien
74117397Skan# Source files linked in via configuration/make substitution for a
75117397Skan# particular target.
76103447Skantarget_sources = \
77103447Skan	codecvt_members.cc \
78103447Skan	collate_members.cc \
79103447Skan	ctype_members.cc \
80103447Skan	messages_members.cc \
81103447Skan	monetary_members.cc \
82103447Skan	numeric_members.cc \
83103447Skan	time_members.cc
84103447Skan
85117397Skancodecvt_members.cc: ${glibcpp_srcdir}/@CCODECVT_CC@
86117397Skan	@LN_S@ ${glibcpp_srcdir}/@CCODECVT_CC@ . || true
87117397Skan
88117397Skancollate_members.cc: ${glibcpp_srcdir}/@CCOLLATE_CC@
89117397Skan	@LN_S@ ${glibcpp_srcdir}/@CCOLLATE_CC@ . || true
90117397Skan
91117397Skanctype_members.cc: ${glibcpp_srcdir}/@CCTYPE_CC@
92117397Skan	@LN_S@ ${glibcpp_srcdir}/@CCTYPE_CC@ . || true
93117397Skan
94117397Skanmessages_members.cc: ${glibcpp_srcdir}/@CMESSAGES_CC@
95117397Skan	@LN_S@ ${glibcpp_srcdir}/@CMESSAGES_CC@ . || true
96117397Skan
97117397Skanmonetary_members.cc: ${glibcpp_srcdir}/@CMONEY_CC@
98117397Skan	@LN_S@ ${glibcpp_srcdir}/@CMONEY_CC@ . || true
99117397Skan
100117397Skannumeric_members.cc: ${glibcpp_srcdir}/@CNUMERIC_CC@
101117397Skan	@LN_S@ ${glibcpp_srcdir}/@CNUMERIC_CC@ . || true
102117397Skan
103117397Skantime_members.cc: ${glibcpp_srcdir}/@CTIME_CC@
104117397Skan	@LN_S@ ${glibcpp_srcdir}/@CTIME_CC@ . || true
105117397Skan
106117397Skan# Source files linked in via configuration/make substitution for a
107117397Skan# particular target, but with ad hoc naming rules.
108103447Skantarget_sources_extra = \
109103447Skan	basic_file.cc \
110103447Skan	c++locale.cc 
111103447Skan
112117397Skanc++locale.cc: ${glibcpp_srcdir}/@CLOCALE_CC@
113117397Skan	@LN_S@ ${glibcpp_srcdir}/@CLOCALE_CC@ ./$@ || true
114117397Skan
115117397Skanbasic_file.cc: ${glibcpp_srcdir}/@BASIC_FILE_CC@
116117397Skan	@LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_CC@ ./$@ || true
117117397Skan
118103447Skan# Sources present in the src directory.
11997403Sobriensources = \
120102782Skan	bitset.cc \
121103447Skan	codecvt.cc \
122103447Skan	complex_io.cc \
123103447Skan	concept-inst.cc \
124103447Skan	ctype.cc \
125103447Skan	ext-inst.cc \
126103447Skan	fstream.cc \
127103447Skan	fstream-inst.cc \
128103447Skan	functexcept.cc \
129103447Skan	globals.cc \
130103447Skan	io-inst.cc \
131103447Skan	ios.cc \
132103447Skan	istream-inst.cc \
133103447Skan	limits.cc \
134103447Skan	locale.cc \
135103447Skan	locale-inst.cc \
136103447Skan	localename.cc \
137103447Skan	misc-inst.cc \
138103447Skan	ostream-inst.cc \
139103447Skan	sstream-inst.cc \
140103447Skan	stdexcept.cc \
141103447Skan	stl-inst.cc \
142103447Skan	streambuf-inst.cc \
143103447Skan	string-inst.cc \
144103447Skan	strstream.cc \
145103447Skan	valarray-inst.cc \
146103447Skan	vterminate.cc \
147103447Skan	wstring-inst.cc \
148103447Skan	${target_sources} \
149103447Skan	${target_sources_extra}
15097403Sobrien
15197403SobrienVPATH = $(top_srcdir)/src:$(top_srcdir)
15297403Sobrien
15397403Sobrienlibstdc___la_SOURCES = $(sources)
15497403Sobrien
15597403Sobrienlibstdc___la_LIBADD = \
156117397Skan	$(top_builddir)/libmath/libmath.la @libio_la@ \
157117397Skan	$(top_builddir)/libsupc++/libsupc++convenience.la
15897403Sobrien
159117397Skanlibstdc___la_DEPENDENCIES = libstdc++-symbol.ver $(libstdc___la_LIBADD)
16097403Sobrien
16197403Sobrienlibstdc___la_LDFLAGS = \
16297403Sobrien	-version-info @libtool_VERSION@ ${version_arg} \
16397403Sobrien	-lm @LIBUNWIND_FLAG@ 
16497403Sobrien
16597403Sobrien
16697403Sobrien# Use special rules for the deprecated source files so that they find
16797403Sobrien# deprecated include files.
16897403SobrienGLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
16997403Sobrienstrstream.lo: strstream.cc
17097403Sobrien	$(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
17197403Sobrienstrstream.o: strstream.cc
17297403Sobrien	$(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
17397403Sobrien
17497403Sobrien# Use special rules for the concept-checking instantiations so that all
17597403Sobrien# the generated template functions are also instantiated.  Force the checks
17697403Sobrien# to be on so that the instantiations are actually seen.
17797403Sobrienconcept-inst.lo: concept-inst.cc
17897403Sobrien	$(LTCXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
17997403Sobrienconcept-inst.o: concept-inst.cc
18097403Sobrien	$(CXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
18197403Sobrien
18297403Sobrien
18397403Sobrien# AM_CXXFLAGS needs to be in each subdirectory so that it can be
18497403Sobrien# modified in a per-library or per-sub-library way.  Need to manually
18597403Sobrien# set this option because CONFIG_CXXFLAGS has to be after
18697403Sobrien# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
187117397Skan# as the occasion call for it. 
18897403SobrienAM_CXXFLAGS = \
18997403Sobrien	-fno-implicit-templates \
19097403Sobrien	$(LIBSUPCXX_CXXFLAGS) \
19197403Sobrien	$(WARN_CXXFLAGS) \
19297403Sobrien	$(OPTIMIZE_CXXFLAGS) \
193117397Skan	$(CONFIG_CXXFLAGS)  
19497403Sobrien
19597403Sobrien
19697403Sobrien# libstdc++ libtool notes
19797403Sobrien
19897403Sobrien# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
19997403Sobrien# last. (That way, things like -O2 passed down from the toplevel can
20097403Sobrien# be overridden by --enable-debug.)
20197403Sobrien
20297403Sobrien# 2) In general, libtool expects an argument such as `--tag=CXX' when
20397403Sobrien# using the C++ compiler, because that will enable the settings
20497403Sobrien# detected when C++ support was being configured.  However, when no
20597403Sobrien# such flag is given in the command line, libtool attempts to figure
20697403Sobrien# it out by matching the compiler name in each configuration section
20797403Sobrien# against a prefix of the command line.  The problem is that, if the
20897403Sobrien# compiler name and its initial flags stored in the libtool
20997403Sobrien# configuration file don't match those in the command line, libtool
21097403Sobrien# can't decide which configuration to use, and it gives up.  The
21197403Sobrien# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
21297403Sobrien# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
21397403Sobrien# attempt to infer which configuration to use
21497403SobrienLTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
21597403Sobrien	       $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
21697403Sobrien
21797403Sobrien# 3) We'd have a problem when building the shared libstdc++ object if
21897403Sobrien# the rules automake generates would be used.  We cannot allow g++ to
21997403Sobrien# be used since this would add -lstdc++ to the link line which of
22097403Sobrien# course is problematic at this point.  So, we get the top-level
22197403Sobrien# directory to configure libstdc++-v3 to use gcc as the C++
22297403Sobrien# compilation driver.
22397403SobrienCXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
22497403Sobrien	  @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
225117397Skan
226117397Skan
227117397Skan# Added bits to build debug library.
228117397Skanif GLIBCPP_BUILD_DEBUG
229117397Skanall-local: build_debug
230117397Skaninstall-data-local: install_debug
231117397Skanelse
232117397Skanall-local:
233117397Skaninstall-data-local: 
234117397Skanendif
235117397Skan
236117397Skandebugdir = debug
237117397Skan
238117397Skan# Build parallel set of debug objects here.
239117397Skanstamp-debug: 
240117397Skan	if test ! -d ${debugdir}; then \
241117397Skan	  mkdir -p ${debugdir}; \
242117397Skan	  (cd ${debugdir}; \
243117397Skan	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
244117397Skan	      -e 's/srcdir = \.\./srcdir = ..\/../' \
245117397Skan	      -e 's/glibcpp_basedir = \.\./glibcpp_basedir = ..\/../' \
246117397Skan	      -e 's/all-local: build_debug/all-local:/' \
247117397Skan	      -e 's/install-data-local: install_debug/install-data-local:/' \
248117397Skan	  < ../Makefile > Makefile) ; \
249117397Skan	fi; \
250117397Skan	echo `date` > stamp-debug; 
251117397Skan
252117397Skanbuild_debug: stamp-debug
253117397Skan	(cd ${debugdir} && $(MAKE) CXXFLAGS='@DEBUG_FLAGS@' all)
254117397Skan
255117397Skan# Install debug library here.
256117397Skaninstall_debug: 
257117397Skan	(cd ${debugdir} && $(MAKE) \
258117397Skan	toolexeclibdir=@glibcpp_toolexeclibdir@/debug install)
259