1 ## Makefile for the C++03 sources of the GNU C++ Standard library.
3 ## Copyright (C) 1997-2015 Free Software Foundation, Inc.
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
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)
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.
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/>.
23 include $(top_srcdir)/fragment.am
25 # Convenience library for C++11 runtime.
26 noinst_LTLIBRARIES = libc++11convenience.la
30 # Source files linked in via configuration/make substitution for a
33 ctype_configure_char.cc \
36 ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc
37 $(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true
39 ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
40 $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
47 cxx11-ios_failure.cc \
48 cxx11-shim_facets.cc \
57 condition_variable.cc \
77 ${cxx11_abi_sources} \
81 extra_string_inst_sources = \
86 cxx11-locale-inst.cc \
89 extra_string_inst_sources =
92 if ENABLE_EXTERN_TEMPLATE
93 # XTEMPLATE_FLAGS = -fno-implicit-templates
95 $(extra_string_inst_sources) \
113 vpath % $(top_srcdir)/src/c++11
115 libc__11convenience_la_SOURCES = $(sources) $(inst_sources)
117 # Use special rules for the hashtable.cc file so that all
118 # the generated template functions are also instantiated.
119 hashtable_c++0x.lo: hashtable_c++0x.cc
120 $(LTCXXCOMPILE) -fimplicit-templates -c $<
121 hashtable_c++0x.o: hashtable_c++0x.cc
122 $(CXXCOMPILE) -fimplicit-templates -c $<
124 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
125 # modified in a per-library or per-sub-library way. Need to manually
126 # set this option because CONFIG_CXXFLAGS has to be after
127 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
128 # as the occasion calls for it.
131 $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
132 $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
133 $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
136 "gxx_include_dir=$(gxx_include_dir)"
140 # 1) In general, libtool expects an argument such as `--tag=CXX' when
141 # using the C++ compiler, because that will enable the settings
142 # detected when C++ support was being configured. However, when no
143 # such flag is given in the command line, libtool attempts to figure
144 # it out by matching the compiler name in each configuration section
145 # against a prefix of the command line. The problem is that, if the
146 # compiler name and its initial flags stored in the libtool
147 # configuration file don't match those in the command line, libtool
148 # can't decide which configuration to use, and it gives up. The
149 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
150 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
151 # attempt to infer which configuration to use.
153 # The second tag argument, `--tag disable-shared` means that libtool
154 # only compiles each source once, for static objects. In actuality,
155 # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
156 # the libtool command that is used create the object, which is
157 # suitable for shared libraries. The `--tag disable-shared` must be
158 # placed after --tag CXX lest things CXX undo the affect of
161 # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is
162 # last. (That way, things like -O2 passed down from the toplevel can
163 # be overridden by --enable-debug.)
165 $(LIBTOOL) --tag CXX --tag disable-shared \
166 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
167 --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
168 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS)
170 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
172 # 3) We'd have a problem when building the shared libstdc++ object if
173 # the rules automake generates would be used. We cannot allow g++ to
174 # be used since this would add -lstdc++ to the link line which of
175 # course is problematic at this point. So, we get the top-level
176 # directory to configure libstdc++-v3 to use gcc as the C++
177 # compilation driver.
179 $(LIBTOOL) --tag CXX --tag disable-shared \
180 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
182 $(VTV_CXXLINKFLAGS) \
183 $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@