]>
Commit | Line | Data |
---|---|---|
8bae34da BK |
1 | ## Makefile for the C++03 sources of the GNU C++ Standard library. |
2 | ## | |
818ab71a | 3 | ## Copyright (C) 1997-2016 Free Software Foundation, Inc. |
8bae34da BK |
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 | ||
23 | include $(top_srcdir)/fragment.am | |
24 | ||
25 | # Convenience library for C++98 runtime. | |
f92ab29f | 26 | noinst_LTLIBRARIES = libc++98convenience.la |
8bae34da BK |
27 | |
28 | headers = | |
29 | ||
34a2b755 JW |
30 | if ENABLE_DUAL_ABI |
31 | cow_string_host_sources = \ | |
32 | collate_members_cow.cc \ | |
33 | messages_members_cow.cc \ | |
34 | monetary_members_cow.cc \ | |
35 | numeric_members_cow.cc | |
36 | endif | |
37 | ||
8bae34da BK |
38 | # Source files linked in via configuration/make substitution for a |
39 | # particular host. | |
40 | host_sources = \ | |
34a2b755 | 41 | $(cow_string_host_sources) \ |
8bae34da BK |
42 | atomicity.cc \ |
43 | codecvt_members.cc \ | |
44 | collate_members.cc \ | |
8bae34da BK |
45 | messages_members.cc \ |
46 | monetary_members.cc \ | |
47 | numeric_members.cc \ | |
48 | time_members.cc | |
49 | ||
50 | codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC) | |
51 | $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true | |
52 | ||
53 | collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC) | |
54 | $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true | |
55 | ||
8bae34da BK |
56 | messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC) |
57 | $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true | |
58 | ||
59 | monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC) | |
60 | $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true | |
61 | ||
62 | numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC) | |
63 | $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true | |
64 | ||
65 | time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC) | |
66 | $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true | |
67 | ||
68 | atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h | |
69 | atomicity.cc: ${atomicity_file} | |
70 | $(LN_S) ${atomicity_file} ./atomicity.cc || true | |
71 | ||
34a2b755 JW |
72 | if ENABLE_DUAL_ABI |
73 | collate_members_cow.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC) | |
74 | $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) ./$@ || true | |
75 | ||
76 | messages_members_cow.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC) | |
77 | $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) ./$@ || true | |
78 | ||
79 | monetary_members_cow.cc: ${glibcxx_srcdir}/$(CMONEY_CC) | |
80 | $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) ./$@ || true | |
81 | ||
82 | numeric_members_cow.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC) | |
83 | $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) ./$@ || true | |
84 | endif | |
85 | ||
8bae34da BK |
86 | # Source files linked in via configuration/make substitution for a |
87 | # particular host, but with ad hoc naming rules. | |
88 | host_sources_extra = \ | |
89 | basic_file.cc c++locale.cc \ | |
0b284728 | 90 | ${inst_sources} ${parallel_sources} |
8bae34da BK |
91 | |
92 | c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC) | |
93 | $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true | |
94 | ||
95 | basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC) | |
96 | $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true | |
97 | ||
34a2b755 JW |
98 | if ENABLE_DUAL_ABI |
99 | cxx11_abi_sources = \ | |
100 | cow-istream-string.cc | |
101 | else | |
102 | cxx11_abi_sources = | |
103 | endif | |
8bae34da | 104 | |
8bae34da | 105 | if ENABLE_EXTERN_TEMPLATE |
2077db1b | 106 | # XTEMPLATE_FLAGS = -fno-implicit-templates |
8bae34da BK |
107 | inst_sources = \ |
108 | allocator-inst.cc \ | |
109 | concept-inst.cc \ | |
110 | ext-inst.cc \ | |
28630cd6 | 111 | misc-inst.cc |
8bae34da | 112 | else |
2077db1b | 113 | # XTEMPLATE_FLAGS = |
8bae34da BK |
114 | inst_sources = |
115 | endif | |
116 | ||
495de4f4 BK |
117 | parallel_sources = parallel_settings.cc |
118 | ||
8bae34da BK |
119 | # Sources present in the src directory, always present. |
120 | sources = \ | |
121 | bitmap_allocator.cc \ | |
122 | pool_allocator.cc \ | |
123 | mt_allocator.cc \ | |
124 | codecvt.cc \ | |
8bae34da | 125 | complex_io.cc \ |
8bae34da BK |
126 | globals_io.cc \ |
127 | hash_tr1.cc \ | |
128 | hashtable_tr1.cc \ | |
8bae34da BK |
129 | ios_failure.cc \ |
130 | ios_init.cc \ | |
131 | ios_locale.cc \ | |
132 | list.cc \ | |
495de4f4 BK |
133 | list-aux.cc \ |
134 | list-aux-2.cc \ | |
135 | list_associated.cc \ | |
136 | list_associated-2.cc \ | |
8bae34da BK |
137 | locale.cc \ |
138 | locale_init.cc \ | |
139 | locale_facets.cc \ | |
140 | localename.cc \ | |
141 | math_stubs_float.cc \ | |
142 | math_stubs_long_double.cc \ | |
143 | stdexcept.cc \ | |
144 | strstream.cc \ | |
145 | tree.cc \ | |
146 | istream.cc \ | |
34a2b755 | 147 | istream-string.cc \ |
8bae34da BK |
148 | streambuf.cc \ |
149 | valarray.cc \ | |
34a2b755 | 150 | ${cxx11_abi_sources} \ |
8bae34da BK |
151 | ${host_sources} \ |
152 | ${host_sources_extra} | |
153 | ||
154 | vpath % $(top_srcdir)/src/c++98 | |
8bae34da | 155 | |
4bca22f3 | 156 | libc__98convenience_la_SOURCES = $(sources) |
8bae34da | 157 | |
9702ee6a FD |
158 | # Use special rules to compile with -fimplicit-templates. |
159 | c++locale.lo: c++locale.cc | |
160 | $(LTCXXCOMPILE) -fimplicit-templates -c $< | |
161 | c++locale.o: c++locale.cc | |
162 | $(CXXCOMPILE) -fimplicit-templates -c $< | |
163 | ||
34a2b755 JW |
164 | if ENABLE_DUAL_ABI |
165 | GLIBCXX_ABI_FLAGS = -D_GLIBCXX_USE_CXX11_ABI=@glibcxx_cxx98_abi@ | |
166 | # Use special rules to compile with the non-default string ABI. | |
167 | collate_members_cow.lo: collate_members_cow.cc | |
168 | $(LTCXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
169 | collate_members_cow.o: collate_members_cow.cc | |
170 | $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
171 | messages_members_cow.lo: messages_members_cow.cc | |
172 | $(LTCXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
173 | messages_members_cow.o: messages_members_cow.cc | |
174 | $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
175 | monetary_members_cow.lo: monetary_members_cow.cc | |
176 | $(LTCXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
177 | monetary_members_cow.o: monetary_members_cow.cc | |
178 | $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
179 | numeric_members_cow.lo: numeric_members_cow.cc | |
180 | $(LTCXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
181 | numeric_members_cow.o: numeric_members_cow.cc | |
182 | $(CXXCOMPILE) $(GLIBCXX_ABI_FLAGS) -fimplicit-templates -c $< | |
183 | endif | |
184 | ||
bb93f35d JW |
185 | # XXX TODO move locale_init.cc and localename.cc to src/c++11 |
186 | locale_init.lo: locale_init.cc | |
187 | $(LTCXXCOMPILE) -std=gnu++11 -c $< | |
188 | locale_init.o: locale_init.cc | |
189 | $(LTCXXCOMPILE) -std=gnu++11 -c $< | |
190 | localename.lo: localename.cc | |
191 | $(LTCXXCOMPILE) -std=gnu++11 -c $< | |
192 | localename.o: localename.cc | |
193 | $(LTCXXCOMPILE) -std=gnu++11 -c $< | |
194 | ||
8bae34da BK |
195 | # Use special rules for the deprecated source files so that they find |
196 | # deprecated include files. | |
197 | GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include | |
198 | strstream.lo: strstream.cc | |
199 | $(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $< | |
200 | strstream.o: strstream.cc | |
201 | $(CXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $< | |
202 | ||
203 | # Use special rules for the concept-checking instantiations so that all | |
204 | # the generated template functions are also instantiated. Force the checks | |
205 | # to be on so that the instantiations are actually seen. | |
206 | concept-inst.lo: concept-inst.cc | |
207 | $(LTCXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $< | |
208 | concept-inst.o: concept-inst.cc | |
209 | $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $< | |
210 | ||
211 | # Use special rules for parallel mode compilation. | |
f92ab29f | 212 | PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL |
8bae34da BK |
213 | parallel_settings.lo: parallel_settings.cc |
214 | $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $< | |
215 | parallel_settings.o: parallel_settings.cc | |
216 | $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< | |
217 | ||
8bae34da BK |
218 | # AM_CXXFLAGS needs to be in each subdirectory so that it can be |
219 | # modified in a per-library or per-sub-library way. Need to manually | |
220 | # set this option because CONFIG_CXXFLAGS has to be after | |
221 | # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden | |
222 | # as the occasion calls for it. | |
223 | AM_CXXFLAGS = \ | |
6cd9cb89 | 224 | -std=gnu++98 \ |
ac6d1200 | 225 | $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \ |
2077db1b | 226 | $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ |
0b284728 | 227 | $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) |
8bae34da BK |
228 | |
229 | AM_MAKEFLAGS = \ | |
230 | "gxx_include_dir=$(gxx_include_dir)" | |
231 | ||
232 | # Libtool notes | |
233 | ||
ac6d1200 | 234 | # 1) In general, libtool expects an argument such as `--tag=CXX' when |
8bae34da BK |
235 | # using the C++ compiler, because that will enable the settings |
236 | # detected when C++ support was being configured. However, when no | |
237 | # such flag is given in the command line, libtool attempts to figure | |
238 | # it out by matching the compiler name in each configuration section | |
239 | # against a prefix of the command line. The problem is that, if the | |
240 | # compiler name and its initial flags stored in the libtool | |
241 | # configuration file don't match those in the command line, libtool | |
242 | # can't decide which configuration to use, and it gives up. The | |
243 | # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe | |
244 | # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to | |
245 | # attempt to infer which configuration to use. | |
f92ab29f | 246 | # |
ac6d1200 BK |
247 | # The second tag argument, `--tag disable-shared` means that libtool |
248 | # only compiles each source once, for static objects. In actuality, | |
249 | # glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to | |
250 | # the libtool command that is used create the object, which is | |
251 | # suitable for shared libraries. The `--tag disable-shared` must be | |
252 | # placed after --tag CXX lest things CXX undo the affect of | |
253 | # disable-shared. | |
254 | ||
b1d6986c | 255 | # 2) Need to explicitly set LTCXXCOMPILE so that EXTRA_CXX_FLAGS is |
ac6d1200 BK |
256 | # last. (That way, things like -O2 passed down from the toplevel can |
257 | # be overridden by --enable-debug.) | |
0b284728 BK |
258 | LTCXXCOMPILE = \ |
259 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
260 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
261 | --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ | |
b1d6986c | 262 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(EXTRA_CXX_FLAGS) |
8bae34da BK |
263 | |
264 | LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) | |
265 | ||
266 | # 3) We'd have a problem when building the shared libstdc++ object if | |
267 | # the rules automake generates would be used. We cannot allow g++ to | |
268 | # be used since this would add -lstdc++ to the link line which of | |
269 | # course is problematic at this point. So, we get the top-level | |
270 | # directory to configure libstdc++-v3 to use gcc as the C++ | |
271 | # compilation driver. | |
0b284728 BK |
272 | CXXLINK = \ |
273 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
274 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
275 | --mode=link $(CXX) \ | |
2077db1b | 276 | $(VTV_CXXLINKFLAGS) \ |
0b284728 | 277 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ |