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