1## Makefile for the C++03 sources of the GNU C++ Standard library.
2##
3## Copyright (C) 1997-2013 Free Software Foundation, Inc.
4##
5## This file is part of the libstdc++ version 3 distribution.
6## Process this file with automake to produce Makefile.in.
7
8## This file is part of the GNU ISO C++ Library.  This library is free
9## software; you can redistribute it and/or modify it under the
10## terms of the GNU General Public License as published by the
11## Free Software Foundation; either version 3, or (at your option)
12## any later version.
13
14## This library is distributed in the hope that it will be useful,
15## but WITHOUT ANY WARRANTY; without even the implied warranty of
16## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17## GNU General Public License for more details.
18
19## You should have received a copy of the GNU General Public License along
20## with this library; see the file COPYING3.  If not see
21## <http://www.gnu.org/licenses/>.
22
23include $(top_srcdir)/fragment.am
24
25# Convenience library for C++98 runtime.
26noinst_LTLIBRARIES = libc++98convenience.la
27
28headers =
29
30# Source files linked in via configuration/make substitution for a
31# particular host.
32host_sources = \
33	atomicity.cc \
34	codecvt_members.cc \
35	collate_members.cc \
36	ctype_configure_char.cc \
37	ctype_members.cc \
38	messages_members.cc \
39	monetary_members.cc \
40	numeric_members.cc \
41	time_members.cc
42
43codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
44	$(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
45
46collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC)
47	$(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true
48
49ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc
50	$(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true
51
52ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
53	$(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
54
55messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC)
56	$(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true
57
58monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC)
59	$(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true
60
61numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC)
62	$(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true
63
64time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC)
65	$(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true
66
67atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
68atomicity.cc: ${atomicity_file}
69	$(LN_S) ${atomicity_file} ./atomicity.cc || true
70
71# Source files linked in via configuration/make substitution for a
72# particular host, but with ad hoc naming rules.
73host_sources_extra = \
74	basic_file.cc c++locale.cc \
75	${inst_sources} ${parallel_sources}
76
77c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
78	$(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
79
80basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
81	$(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
82
83
84if ENABLE_EXTERN_TEMPLATE
85XTEMPLATE_FLAGS = -fno-implicit-templates
86inst_sources = \
87	allocator-inst.cc \
88	concept-inst.cc \
89	ext-inst.cc \
90	ios-inst.cc \
91	iostream-inst.cc \
92	istream-inst.cc \
93	locale-inst.cc \
94	misc-inst.cc \
95	ostream-inst.cc \
96	sstream-inst.cc \
97	streambuf-inst.cc \
98	wlocale-inst.cc
99else
100XTEMPLATE_FLAGS =
101inst_sources =
102endif
103
104parallel_sources = parallel_settings.cc
105
106# Sources present in the src directory, always present.
107sources = \
108	bitmap_allocator.cc \
109	pool_allocator.cc \
110	mt_allocator.cc \
111	codecvt.cc \
112	complex_io.cc \
113	ctype.cc \
114	globals_io.cc \
115	hash_tr1.cc \
116	hashtable_tr1.cc \
117	ios.cc \
118	ios_failure.cc \
119	ios_init.cc \
120	ios_locale.cc \
121	list.cc \
122	list-aux.cc \
123	list-aux-2.cc \
124	list_associated.cc \
125	list_associated-2.cc \
126	locale.cc \
127	locale_init.cc \
128	locale_facets.cc \
129	localename.cc \
130	math_stubs_float.cc \
131	math_stubs_long_double.cc \
132	stdexcept.cc \
133	strstream.cc \
134	tree.cc \
135	istream.cc \
136	streambuf.cc \
137	valarray.cc \
138	${host_sources} \
139	${host_sources_extra}
140
141vpath % $(top_srcdir)/src/c++98
142
143libc__98convenience_la_SOURCES = $(sources)
144
145# Use special rules for the deprecated source files so that they find
146# deprecated include files.
147GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include
148strstream.lo: strstream.cc
149	$(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
150strstream.o: strstream.cc
151	$(CXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
152
153# Use special rules for the concept-checking instantiations so that all
154# the generated template functions are also instantiated.  Force the checks
155# to be on so that the instantiations are actually seen.
156concept-inst.lo: concept-inst.cc
157	$(LTCXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
158concept-inst.o: concept-inst.cc
159	$(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
160
161# Use special rules for parallel mode compilation.
162PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL
163parallel_settings.lo: parallel_settings.cc
164	$(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $<
165parallel_settings.o: parallel_settings.cc
166	$(CXXCOMPILE) $(PARALLEL_FLAGS) -c $<
167
168# AM_CXXFLAGS needs to be in each subdirectory so that it can be
169# modified in a per-library or per-sub-library way.  Need to manually
170# set this option because CONFIG_CXXFLAGS has to be after
171# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
172# as the occasion calls for it.
173AM_CXXFLAGS = \
174	$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
175	$(XTEMPLATE_FLAGS) \
176	$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
177
178AM_MAKEFLAGS = \
179	"gxx_include_dir=$(gxx_include_dir)"
180
181# Libtool notes
182
183# 1) In general, libtool expects an argument such as `--tag=CXX' when
184# using the C++ compiler, because that will enable the settings
185# detected when C++ support was being configured.  However, when no
186# such flag is given in the command line, libtool attempts to figure
187# it out by matching the compiler name in each configuration section
188# against a prefix of the command line.  The problem is that, if the
189# compiler name and its initial flags stored in the libtool
190# configuration file don't match those in the command line, libtool
191# can't decide which configuration to use, and it gives up.  The
192# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
193# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
194# attempt to infer which configuration to use.
195#
196# The second tag argument, `--tag disable-shared` means that libtool
197# only compiles each source once, for static objects. In actuality,
198# glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
199# the libtool command that is used create the object, which is
200# suitable for shared libraries.  The `--tag disable-shared` must be
201# placed after --tag CXX lest things CXX undo the affect of
202# disable-shared.
203
204# 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is
205# last. (That way, things like -O2 passed down from the toplevel can
206# be overridden by --enable-debug.)
207LTCXXCOMPILE = \
208	$(LIBTOOL) --tag CXX --tag disable-shared \
209	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
210	--mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
211	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS)
212
213LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
214
215# 3) We'd have a problem when building the shared libstdc++ object if
216# the rules automake generates would be used.  We cannot allow g++ to
217# be used since this would add -lstdc++ to the link line which of
218# course is problematic at this point.  So, we get the top-level
219# directory to configure libstdc++-v3 to use gcc as the C++
220# compilation driver.
221CXXLINK = \
222	$(LIBTOOL) --tag CXX --tag disable-shared \
223	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
224	--mode=link $(CXX) \
225	$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
226