Makefile.am revision 103447
1214571Sdim## Makefile for the src subdirectory of the GNU C++ Standard library.
2214571Sdim##
3214571Sdim## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
4214571Sdim## Free Software Foundation, Inc.
5214571Sdim##
6214571Sdim## This file is part of the libstdc++ version 3 distribution.
7214571Sdim## Process this file with automake to produce Makefile.in.
8214571Sdim
9214571Sdim## This file is part of the GNU ISO C++ Library.  This library is free
10214571Sdim## software; you can redistribute it and/or modify it under the
11214571Sdim## terms of the GNU General Public License as published by the
12214571Sdim## Free Software Foundation; either version 2, or (at your option)
13214571Sdim## any later version.
14214571Sdim
15214571Sdim## This library is distributed in the hope that it will be useful,
16214571Sdim## but WITHOUT ANY WARRANTY; without even the implied warranty of
17214571Sdim## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18214571Sdim## GNU General Public License for more details.
19214571Sdim
20214571Sdim## You should have received a copy of the GNU General Public License along
21214571Sdim## with this library; see the file COPYING.  If not, write to the Free
22214571Sdim## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
23214571Sdim## USA.
24214571Sdim
25214571SdimAUTOMAKE_OPTIONS = 1.3 cygnus
26214571SdimMAINT_CHARSET = latin1
27214571Sdim
28214571Sdimmkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
29214571Sdim
30214571Sdim# Cross compiler support.
31214571SdimCXX = @glibcpp_CXX@
32214571Sdimtoolexecdir = @glibcpp_toolexecdir@
33214571Sdimtoolexeclibdir = @glibcpp_toolexeclibdir@
34214571Sdimtoolexeclib_LTLIBRARIES = libstdc++.la
35214571Sdim
36214571Sdim# Compile flags that should be constant throughout the build, both for
37214571Sdim# SUBDIRS and for libstdc++-v3 in general.
38214571SdimOPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
39214571Sdim
40214571Sdim# These bits are all figured out from configure. Look in acinclude.m4
41214571Sdim# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
42214571Sdim# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
43214571SdimCONFIG_CXXFLAGS = \
44214571Sdim	@EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @DEBUG_FLAGS@ 
45214571Sdim
46214571Sdim# Warning flags to use.
47214571SdimWARN_CXXFLAGS = \
48214571Sdim	@WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
49214571Sdim
50214571Sdim# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
51214571SdimGLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
52214571SdimLIBMATH_INCLUDES = @LIBMATH_INCLUDES@
53214571SdimLIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
54214571SdimLIBIO_INCLUDES = @LIBIO_INCLUDES@
55214571SdimTOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
56214571Sdim
57214571SdimINCLUDES = \
58214571Sdim	-nostdinc++ \
59214571Sdim	$(GLIBCPP_INCLUDES) \
60214571Sdim	$(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
61214571Sdim	$(TOPLEVEL_INCLUDES)
62214571Sdim
63214571Sdim# Source files linked in via configuration magic for a particular target.
64214571Sdimtarget_sources = \
65214571Sdim	codecvt_members.cc \
66214571Sdim	collate_members.cc \
67214571Sdim	ctype_members.cc \
68214571Sdim	messages_members.cc \
69214571Sdim	monetary_members.cc \
70214571Sdim	numeric_members.cc \
71214571Sdim	time_members.cc
72214571Sdim
73214571Sdim# Source files linked in via configuration magic for a particular
74214571Sdim# target, but with ad hoc naming rules.
75214571Sdimtarget_sources_extra = \
76214571Sdim	basic_file.cc \
77214571Sdim	c++locale.cc 
78214571Sdim
79214571Sdim# Sources present in the src directory.
80214571Sdimsources = \
81214571Sdim	bitset.cc \
82214571Sdim	codecvt.cc \
83214571Sdim	complex_io.cc \
84214571Sdim	concept-inst.cc \
85214571Sdim	ctype.cc \
86214571Sdim	ext-inst.cc \
87214571Sdim	fstream.cc \
88214571Sdim	fstream-inst.cc \
89214571Sdim	functexcept.cc \
90214571Sdim	globals.cc \
91214571Sdim	io-inst.cc \
92214571Sdim	ios.cc \
93214571Sdim	istream-inst.cc \
94214571Sdim	limits.cc \
95214571Sdim	locale.cc \
96214571Sdim	locale-inst.cc \
97214571Sdim	localename.cc \
98214571Sdim	misc-inst.cc \
99214571Sdim	ostream-inst.cc \
100214571Sdim	sstream-inst.cc \
101214571Sdim	stdexcept.cc \
102214571Sdim	stl-inst.cc \
103214571Sdim	streambuf-inst.cc \
104214571Sdim	string-inst.cc \
105214571Sdim	strstream.cc \
106214571Sdim	valarray-inst.cc \
107214571Sdim	vterminate.cc \
108214571Sdim	wstring-inst.cc \
109214571Sdim	${target_sources} \
110214571Sdim	${target_sources_extra}
111214571Sdim
112214571SdimVPATH = $(top_srcdir)/src:$(top_srcdir)
113214571Sdim
114214571Sdimlibstdc___la_SOURCES = $(sources)
115214571Sdim
116214571Sdimlibstdc___la_LIBADD = \
117214571Sdim	../libmath/libmath.la @libio_la@ \
118214571Sdim	../libsupc++/libsupc++convenience.la
119214571Sdim
120214571Sdimif GLIBCPP_BUILD_VERSIONED_SHLIB
121214571Sdimversion_arg=-Wl,--version-script=linker.map
122214571Sdimelse
123214571Sdimversion_arg=
124214571Sdimendif
125214571Sdim
126214571Sdimlibstdc___la_LDFLAGS = \
127214571Sdim	-version-info @libtool_VERSION@ ${version_arg} \
128214571Sdim	-lm @LIBUNWIND_FLAG@ 
129214571Sdim
130214571Sdimlibstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) linker.map
131214571Sdim
132214571Sdim# Use special rules for the deprecated source files so that they find
133214571Sdim# deprecated include files.
134214571SdimGLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
135214571Sdimstrstream.lo: strstream.cc
136214571Sdim	$(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
137214571Sdimstrstream.o: strstream.cc
138214571Sdim	$(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
139214571Sdim
140214571Sdim# Use special rules for the concept-checking instantiations so that all
141214571Sdim# the generated template functions are also instantiated.  Force the checks
142214571Sdim# to be on so that the instantiations are actually seen.
143214571Sdimconcept-inst.lo: concept-inst.cc
144214571Sdim	$(LTCXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
145214571Sdimconcept-inst.o: concept-inst.cc
146214571Sdim	$(CXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
147214571Sdim
148214571Sdim
149214571Sdim# AM_CXXFLAGS needs to be in each subdirectory so that it can be
150214571Sdim# modified in a per-library or per-sub-library way.  Need to manually
151214571Sdim# set this option because CONFIG_CXXFLAGS has to be after
152214571Sdim# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
153214571Sdim# as the occasion call for it. (ie, --enable-debug)
154214571SdimAM_CXXFLAGS = \
155214571Sdim	-fno-implicit-templates \
156214571Sdim	$(LIBSUPCXX_CXXFLAGS) \
157214571Sdim	$(WARN_CXXFLAGS) \
158214571Sdim	$(OPTIMIZE_CXXFLAGS) \
159214571Sdim	$(CONFIG_CXXFLAGS) 
160214571Sdim
161214571Sdim
162214571Sdim# libstdc++ libtool notes
163214571Sdim
164214571Sdim# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
165214571Sdim# last. (That way, things like -O2 passed down from the toplevel can
166214571Sdim# be overridden by --enable-debug.)
167214571Sdim
168214571Sdim# 2) In general, libtool expects an argument such as `--tag=CXX' when
169214571Sdim# using the C++ compiler, because that will enable the settings
170214571Sdim# detected when C++ support was being configured.  However, when no
171214571Sdim# such flag is given in the command line, libtool attempts to figure
172214571Sdim# it out by matching the compiler name in each configuration section
173214571Sdim# against a prefix of the command line.  The problem is that, if the
174214571Sdim# compiler name and its initial flags stored in the libtool
175214571Sdim# configuration file don't match those in the command line, libtool
176214571Sdim# can't decide which configuration to use, and it gives up.  The
177214571Sdim# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
178214571Sdim# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
179214571Sdim# attempt to infer which configuration to use
180214571SdimLTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
181214571Sdim	       $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
182214571Sdim
183214571Sdim# 3) We'd have a problem when building the shared libstdc++ object if
184214571Sdim# the rules automake generates would be used.  We cannot allow g++ to
185214571Sdim# be used since this would add -lstdc++ to the link line which of
186214571Sdim# course is problematic at this point.  So, we get the top-level
187214571Sdim# directory to configure libstdc++-v3 to use gcc as the C++
188214571Sdim# compilation driver.
189214571SdimCXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
190214571Sdim	  @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
191214571Sdim