]>
Commit | Line | Data |
---|---|---|
8bae34da BK |
1 | ## Makefile for the C++03 sources of the GNU C++ Standard library. |
2 | ## | |
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. | |
6 | ## | |
7 | ## This file is part of the libstdc++ version 3 distribution. | |
8 | ## Process this file with automake to produce Makefile.in. | |
9 | ||
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) | |
14 | ## any later version. | |
15 | ||
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. | |
20 | ||
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/>. | |
24 | ||
25 | include $(top_srcdir)/fragment.am | |
26 | ||
27 | # Convenience library for C++98 runtime. | |
0b284728 | 28 | noinst_LTLIBRARIES = libc++98convenience.la |
8bae34da BK |
29 | |
30 | headers = | |
31 | ||
32 | # Source files linked in via configuration/make substitution for a | |
33 | # particular host. | |
34 | host_sources = \ | |
35 | atomicity.cc \ | |
36 | codecvt_members.cc \ | |
37 | collate_members.cc \ | |
38 | ctype_configure_char.cc \ | |
39 | ctype_members.cc \ | |
40 | messages_members.cc \ | |
41 | monetary_members.cc \ | |
42 | numeric_members.cc \ | |
43 | time_members.cc | |
44 | ||
45 | codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC) | |
46 | $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true | |
47 | ||
48 | collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC) | |
49 | $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true | |
50 | ||
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 | |
53 | ||
54 | ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC) | |
55 | $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true | |
56 | ||
57 | messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC) | |
58 | $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true | |
59 | ||
60 | monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC) | |
61 | $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true | |
62 | ||
63 | numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC) | |
64 | $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true | |
65 | ||
66 | time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC) | |
67 | $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true | |
68 | ||
69 | atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h | |
70 | atomicity.cc: ${atomicity_file} | |
71 | $(LN_S) ${atomicity_file} ./atomicity.cc || true | |
72 | ||
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 \ | |
0b284728 | 77 | ${inst_sources} ${parallel_sources} |
8bae34da BK |
78 | |
79 | c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC) | |
80 | $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true | |
81 | ||
82 | basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC) | |
83 | $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true | |
84 | ||
85 | if ENABLE_PARALLEL | |
0b284728 | 86 | parallel_sources = parallel_settings.cc |
8bae34da BK |
87 | else |
88 | parallel_sources = | |
89 | endif | |
90 | ||
8bae34da BK |
91 | if ENABLE_EXTERN_TEMPLATE |
92 | XTEMPLATE_FLAGS = -fno-implicit-templates | |
93 | inst_sources = \ | |
94 | allocator-inst.cc \ | |
95 | concept-inst.cc \ | |
96 | ext-inst.cc \ | |
97 | ios-inst.cc \ | |
98 | iostream-inst.cc \ | |
99 | istream-inst.cc \ | |
100 | locale-inst.cc \ | |
101 | misc-inst.cc \ | |
102 | ostream-inst.cc \ | |
103 | sstream-inst.cc \ | |
104 | streambuf-inst.cc \ | |
105 | wlocale-inst.cc | |
106 | else | |
107 | XTEMPLATE_FLAGS = | |
108 | inst_sources = | |
109 | endif | |
110 | ||
111 | # Sources present in the src directory, always present. | |
112 | sources = \ | |
113 | bitmap_allocator.cc \ | |
114 | pool_allocator.cc \ | |
115 | mt_allocator.cc \ | |
116 | codecvt.cc \ | |
8bae34da BK |
117 | complex_io.cc \ |
118 | ctype.cc \ | |
119 | globals_io.cc \ | |
120 | hash_tr1.cc \ | |
121 | hashtable_tr1.cc \ | |
122 | ios.cc \ | |
123 | ios_failure.cc \ | |
124 | ios_init.cc \ | |
125 | ios_locale.cc \ | |
126 | list.cc \ | |
127 | locale.cc \ | |
128 | locale_init.cc \ | |
129 | locale_facets.cc \ | |
130 | localename.cc \ | |
131 | math_stubs_float.cc \ | |
132 | math_stubs_long_double.cc \ | |
133 | stdexcept.cc \ | |
134 | strstream.cc \ | |
135 | tree.cc \ | |
136 | istream.cc \ | |
137 | streambuf.cc \ | |
138 | valarray.cc \ | |
139 | ${host_sources} \ | |
140 | ${host_sources_extra} | |
141 | ||
142 | vpath % $(top_srcdir)/src/c++98 | |
8bae34da | 143 | |
4bca22f3 | 144 | libc__98convenience_la_SOURCES = $(sources) |
8bae34da BK |
145 | |
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 $< | |
153 | ||
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 $< | |
161 | ||
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 $< | |
168 | ||
8bae34da BK |
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. | |
174 | AM_CXXFLAGS = \ | |
175 | $(PIC_CXXFLAGS) \ | |
176 | $(XTEMPLATE_FLAGS) \ | |
0b284728 | 177 | $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) |
8bae34da BK |
178 | |
179 | AM_MAKEFLAGS = \ | |
180 | "gxx_include_dir=$(gxx_include_dir)" | |
181 | ||
182 | # Libtool notes | |
183 | ||
184 | # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is | |
185 | # last. (That way, things like -O2 passed down from the toplevel can | |
186 | # be overridden by --enable-debug.) | |
187 | ||
188 | # 2) In general, libtool expects an argument such as `--tag=CXX' when | |
189 | # using the C++ compiler, because that will enable the settings | |
190 | # detected when C++ support was being configured. However, when no | |
191 | # such flag is given in the command line, libtool attempts to figure | |
192 | # it out by matching the compiler name in each configuration section | |
193 | # against a prefix of the command line. The problem is that, if the | |
194 | # compiler name and its initial flags stored in the libtool | |
195 | # configuration file don't match those in the command line, libtool | |
196 | # can't decide which configuration to use, and it gives up. The | |
197 | # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe | |
198 | # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to | |
199 | # attempt to infer which configuration to use. | |
200 | # We have to put --tag disable-shared after --tag CXX lest things | |
201 | # CXX undo the affect of disable-shared. | |
0b284728 BK |
202 | LTCXXCOMPILE = \ |
203 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
204 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
205 | --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ | |
206 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) | |
8bae34da BK |
207 | |
208 | LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) | |
209 | ||
210 | # 3) We'd have a problem when building the shared libstdc++ object if | |
211 | # the rules automake generates would be used. We cannot allow g++ to | |
212 | # be used since this would add -lstdc++ to the link line which of | |
213 | # course is problematic at this point. So, we get the top-level | |
214 | # directory to configure libstdc++-v3 to use gcc as the C++ | |
215 | # compilation driver. | |
0b284728 BK |
216 | CXXLINK = \ |
217 | $(LIBTOOL) --tag CXX --tag disable-shared \ | |
218 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ | |
219 | --mode=link $(CXX) \ | |
220 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ |