1 ## Makefile for the C++03 sources of the GNU C++ Standard library.
3 ## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4 ## 2006, 2007, 2008, 2009, 2010, 2011, 2012
5 ## Free Software Foundation, Inc.
7 ## This file is part of the libstdc++ version 3 distribution.
8 ## Process this file with automake to produce Makefile.in.
10 ## This file is part of the GNU ISO C++ Library. This library is free
11 ## software; you can redistribute it and/or modify it under the
12 ## terms of the GNU General Public License as published by the
13 ## Free Software Foundation; either version 3, or (at your option)
16 ## This library is distributed in the hope that it will be useful,
17 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ## GNU General Public License for more details.
21 ## You should have received a copy of the GNU General Public License along
22 ## with this library; see the file COPYING3. If not see
23 ## <http://www.gnu.org/licenses/>.
25 include $(top_srcdir)/fragment.am
27 # Convenience library for C++98 runtime.
28 noinst_LTLIBRARIES = libc++98convenience.la
32 # Source files linked in via configuration/make substitution for a
38 ctype_configure_char.cc \
45 codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
46 $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
48 collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC)
49 $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true
51 ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc
52 $(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true
54 ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
55 $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
57 messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC)
58 $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true
60 monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC)
61 $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true
63 numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC)
64 $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true
66 time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC)
67 $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true
69 atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
70 atomicity.cc: ${atomicity_file}
71 $(LN_S) ${atomicity_file} ./atomicity.cc || true
73 # Source files linked in via configuration/make substitution for a
74 # particular host, but with ad hoc naming rules.
75 host_sources_extra = \
76 basic_file.cc c++locale.cc \
77 ${inst_sources} ${parallel_sources}
79 c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
80 $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
82 basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
83 $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
86 parallel_sources = parallel_settings.cc
91 if ENABLE_EXTERN_TEMPLATE
92 XTEMPLATE_FLAGS = -fno-implicit-templates
111 # Sources present in the src directory, always present.
113 bitmap_allocator.cc \
131 math_stubs_float.cc \
132 math_stubs_long_double.cc \
140 ${host_sources_extra}
142 vpath % $(top_srcdir)/src/c++98
144 libc__98convenience_la_SOURCES = $(sources)
146 # Use special rules for the deprecated source files so that they find
147 # deprecated include files.
148 GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include
149 strstream.lo: strstream.cc
150 $(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
151 strstream.o: strstream.cc
152 $(CXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
154 # Use special rules for the concept-checking instantiations so that all
155 # the generated template functions are also instantiated. Force the checks
156 # to be on so that the instantiations are actually seen.
157 concept-inst.lo: concept-inst.cc
158 $(LTCXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
159 concept-inst.o: concept-inst.cc
160 $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
162 # Use special rules for parallel mode compilation.
163 PARALLEL_FLAGS = -fopenmp -D_GLIBCXX_PARALLEL -I$(glibcxx_builddir)/../libgomp
164 parallel_settings.lo: parallel_settings.cc
165 $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $<
166 parallel_settings.o: parallel_settings.cc
167 $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $<
169 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
170 # modified in a per-library or per-sub-library way. Need to manually
171 # set this option because CONFIG_CXXFLAGS has to be after
172 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
173 # as the occasion calls for it.
175 $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
177 $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
180 "gxx_include_dir=$(gxx_include_dir)"
184 # 1) In general, libtool expects an argument such as `--tag=CXX' when
185 # using the C++ compiler, because that will enable the settings
186 # detected when C++ support was being configured. However, when no
187 # such flag is given in the command line, libtool attempts to figure
188 # it out by matching the compiler name in each configuration section
189 # against a prefix of the command line. The problem is that, if the
190 # compiler name and its initial flags stored in the libtool
191 # configuration file don't match those in the command line, libtool
192 # can't decide which configuration to use, and it gives up. The
193 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
194 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
195 # attempt to infer which configuration to use.
197 # The second tag argument, `--tag disable-shared` means that libtool
198 # only compiles each source once, for static objects. In actuality,
199 # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
200 # the libtool command that is used create the object, which is
201 # suitable for shared libraries. The `--tag disable-shared` must be
202 # placed after --tag CXX lest things CXX undo the affect of
205 # 2) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
206 # last. (That way, things like -O2 passed down from the toplevel can
207 # be overridden by --enable-debug.)
209 $(LIBTOOL) --tag CXX --tag disable-shared \
210 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
211 --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
212 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
214 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
216 # 3) We'd have a problem when building the shared libstdc++ object if
217 # the rules automake generates would be used. We cannot allow g++ to
218 # be used since this would add -lstdc++ to the link line which of
219 # course is problematic at this point. So, we get the top-level
220 # directory to configure libstdc++-v3 to use gcc as the C++
221 # compilation driver.
223 $(LIBTOOL) --tag CXX --tag disable-shared \
224 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
226 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@