OSDN Git Service

* include/backward/binders.h: Fix examples in doxygen comments and
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / src / Makefile.am
1 ## Makefile for the src subdirectory 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
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 # Cross compiler support.
28 toolexeclib_LTLIBRARIES = libstdc++.la
29
30 # Symbol versioning for shared libraries.
31 if ENABLE_SYMVERS
32 libstdc++-symbols.ver:  ${glibcxx_srcdir}/$(SYMVER_FILE) \
33                 $(port_specific_symbol_files)
34         cp ${glibcxx_srcdir}/$(SYMVER_FILE) ./libstdc++-symbols.ver
35         chmod +w ./libstdc++-symbols.ver
36         if test "x$(port_specific_symbol_files)" != x; then \
37           if grep '^# Appended to version file.' \
38                $(port_specific_symbol_files) /dev/null > /dev/null 2>&1; then \
39             cat $(port_specific_symbol_files) >> $@; \
40           else \
41             sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
42             sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
43             cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
44             rm tmp.top tmp.bottom; \
45           fi; \
46         fi
47
48 CLEANFILES = libstdc++-symbols.ver
49
50 if ENABLE_SYMVERS_GNU
51 if ENABLE_SYMVERS_SOL2
52 version_arg = -Wl,--version-script,libstdc++-symbols.ver-sol2
53 version_dep = libstdc++-symbols.ver-sol2
54 libstdc++-symbols.ver-sol2 : libstdc++-symbols.ver
55         sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
56          > $@ || (rm -f $@ ; exit 1)
57 else
58 version_arg = -Wl,--version-script=libstdc++-symbols.ver
59 version_dep = libstdc++-symbols.ver
60 endif
61 endif
62 if ENABLE_SYMVERS_GNU_NAMESPACE
63 version_arg = -Wl,--version-script=libstdc++-symbols.ver
64 version_dep = libstdc++-symbols.ver
65 endif
66 if ENABLE_SYMVERS_SUN
67 version_arg = -Wl,-M,libstdc++-symbols.ver-sun
68 version_dep = libstdc++-symbols.ver-sun
69 libstdc++-symbols.ver-sun : libstdc++-symbols.ver \
70                 $(toplevel_srcdir)/contrib/make_sunver.pl \
71                 $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
72         CXXFILT="$(CXXFILT)"; export CXXFILT; \
73         perl $(toplevel_srcdir)/contrib/make_sunver.pl \
74           libstdc++-symbols.ver \
75           $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
76          `echo $(libstdc___la_LIBADD) | \
77             sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
78          > $@ || (rm -f $@ ; exit 1)
79 endif
80 if ENABLE_SYMVERS_DARWIN
81 version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist
82 version_dep = libstdc++-symbols.explist
83 libstdc++-symbols.explist : libstdc++-symbols.ver \
84                 ${glibcxx_srcdir}/scripts/make_exports.pl \
85                 $(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
86         perl ${glibcxx_srcdir}/scripts/make_exports.pl \
87           libstdc++-symbols.ver \
88           $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
89          `echo $(libstdc___la_LIBADD) | \
90             sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
91          > $@ || (rm -f $@ ; exit 1)
92 endif
93
94 CLEANFILES += $(version_dep)
95 else
96 version_arg =
97 version_dep =
98 endif
99
100
101 # Source files linked in via configuration/make substitution for a
102 # particular host.
103 host_sources = \
104         atomicity.cc \
105         codecvt_members.cc \
106         collate_members.cc \
107         ctype_configure_char.cc \
108         ctype_members.cc \
109         messages_members.cc \
110         monetary_members.cc \
111         numeric_members.cc \
112         time_members.cc
113
114 codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
115         $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
116
117 collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC)
118         $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true
119
120 ctype_configure_char.cc: ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc
121         $(LN_S) ${glibcxx_srcdir}/$(OS_INC_SRCDIR)/ctype_configure_char.cc . || true
122
123 ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
124         $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
125
126 messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC)
127         $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true
128
129 monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC)
130         $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true
131
132 numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC)
133         $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true
134
135 time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC)
136         $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true
137
138 atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
139 atomicity.cc: ${atomicity_file}
140         $(LN_S) ${atomicity_file} ./atomicity.cc || true
141
142 # Source files linked in via configuration/make substitution for a
143 # particular host, but with ad hoc naming rules.
144 host_sources_extra = \
145         basic_file.cc c++locale.cc \
146         ${inst_sources} ${ldbl_compat_sources} ${parallel_sources}
147
148 c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
149         $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
150
151 basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
152         $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
153
154 if ENABLE_PARALLEL
155 parallel_sources = parallel_settings.cc \
156                    compatibility-parallel_list.cc \
157                    compatibility-parallel_list-2.cc
158 else
159 parallel_sources =
160 endif
161
162 if GLIBCXX_LDBL_COMPAT
163 ldbl_compat_sources = compatibility-ldbl.cc
164 else
165 ldbl_compat_sources =
166 endif
167
168 if ENABLE_EXTERN_TEMPLATE
169 XTEMPLATE_FLAGS = -fno-implicit-templates
170 inst_sources = \
171         allocator-inst.cc \
172         concept-inst.cc \
173         ext-inst.cc \
174         fstream-inst.cc \
175         ios-inst.cc \
176         iostream-inst.cc \
177         istream-inst.cc \
178         locale-inst.cc \
179         misc-inst.cc \
180         ostream-inst.cc \
181         sstream-inst.cc \
182         streambuf-inst.cc \
183         string-inst.cc \
184         wlocale-inst.cc \
185         wstring-inst.cc
186 else
187 XTEMPLATE_FLAGS =
188 inst_sources =
189 endif
190
191 # Sources present in the src directory, always present.
192 sources = \
193         bitmap_allocator.cc \
194         pool_allocator.cc \
195         mt_allocator.cc \
196         codecvt.cc \
197         compatibility.cc \
198         compatibility-c++0x.cc \
199         compatibility-atomic-c++0x.cc \
200         compatibility-debug_list.cc \
201         compatibility-debug_list-2.cc \
202         compatibility-list.cc \
203         compatibility-list-2.cc \
204         complex_io.cc \
205         ctype.cc \
206         debug.cc \
207         functexcept.cc \
208         functional.cc \
209         globals_io.cc \
210         hash_c++0x.cc \
211         hash_tr1.cc \
212         hashtable_c++0x.cc \
213         hashtable_tr1.cc \
214         ios.cc \
215         ios_failure.cc \
216         ios_init.cc \
217         ios_locale.cc \
218         limits.cc \
219         list.cc \
220         locale.cc \
221         locale_init.cc \
222         locale_facets.cc \
223         localename.cc \
224         math_stubs_float.cc \
225         math_stubs_long_double.cc \
226         stdexcept.cc \
227         strstream.cc \
228         system_error.cc \
229         tree.cc \
230         istream.cc \
231         placeholders.cc \
232         regex.cc \
233         shared_ptr.cc \
234         streambuf.cc \
235         mutex.cc \
236         condition_variable.cc \
237         chrono.cc \
238         thread.cc \
239         future.cc \
240         valarray.cc \
241         ${host_sources} \
242         ${host_sources_extra}
243
244 vpath % $(top_srcdir)/src
245 vpath % $(top_srcdir)
246
247 libstdc___la_SOURCES = $(sources)
248
249 libstdc___la_LIBADD = \
250         $(GLIBCXX_LIBS) \
251         $(top_builddir)/libsupc++/libsupc++convenience.la
252
253 libstdc___la_DEPENDENCIES = \
254         ${version_dep} \
255         $(top_builddir)/libsupc++/libsupc++convenience.la
256
257 libstdc___la_LDFLAGS = \
258         -version-info $(libtool_VERSION) ${version_arg} -lm
259
260 libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
261
262 # Use special rules for the deprecated source files so that they find
263 # deprecated include files.
264 GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include
265 strstream.lo: strstream.cc
266         $(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
267 strstream.o: strstream.cc
268         $(CXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
269
270 # Use special rules for the concept-checking instantiations so that all
271 # the generated template functions are also instantiated.  Force the checks
272 # to be on so that the instantiations are actually seen.
273 concept-inst.lo: concept-inst.cc
274         $(LTCXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
275 concept-inst.o: concept-inst.cc
276         $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
277
278 # Use special rules for parallel mode compilation.
279 PARALLEL_FLAGS = -fopenmp -D_GLIBCXX_PARALLEL -I$(glibcxx_builddir)/../libgomp
280 parallel_settings.lo: parallel_settings.cc
281         $(LTCXXCOMPILE) $(PARALLEL_FLAGS) -c $<
282 parallel_settings.o: parallel_settings.cc
283         $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $<
284
285 compatibility-parallel_list.lo: compatibility-parallel_list.cc
286         $(LTCXXCOMPILE) -c $<
287 compatibility-parallel_list.o: compatibility-parallel_list.cc
288         $(CXXCOMPILE) -c $<
289
290 compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc
291         $(LTCXXCOMPILE) -c $<
292 compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc
293         $(CXXCOMPILE) -c $<
294
295 # Use special rules for the C++0x sources so that the proper flags are passed.
296 functexcept.lo: functexcept.cc
297         $(LTCXXCOMPILE) -std=gnu++0x -c $<
298 functexcept.o: functexcept.cc
299         $(CXXCOMPILE) -std=gnu++0x -c $<
300
301 shared_ptr.lo: shared_ptr.cc
302         $(LTCXXCOMPILE) -std=gnu++0x -c $<
303 shared_ptr.o: shared_ptr.cc
304         $(CXXCOMPILE) -std=gnu++0x -c $<
305
306 system_error.lo: system_error.cc
307         $(LTCXXCOMPILE) -std=gnu++0x -c $<
308 system_error.o: system_error.cc
309         $(CXXCOMPILE) -std=gnu++0x -c $<
310
311 mutex.lo: mutex.cc
312         $(LTCXXCOMPILE) -std=gnu++0x -c $<
313 mutex.o: mutex.cc
314         $(CXXCOMPILE) -std=gnu++0x -c $<
315
316 condition_variable.lo: condition_variable.cc
317         $(LTCXXCOMPILE) -std=gnu++0x -c $<
318 condition_variable.o: condition_variable.cc
319         $(CXXCOMPILE) -std=gnu++0x -c $<
320
321 compatibility-c++0x.lo: compatibility-c++0x.cc
322         $(LTCXXCOMPILE) -std=gnu++0x -c $<
323 compatibility-c++0x.o: compatibility-c++0x.cc
324         $(CXXCOMPILE) -std=gnu++0x -c $<
325
326 compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc
327         $(LTCXXCOMPILE) -std=gnu++0x -c $<
328 compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc
329         $(CXXCOMPILE) -std=gnu++0x -c $<
330
331 functional.lo: functional.cc
332         $(LTCXXCOMPILE) -std=gnu++0x -c $<
333 functional.o: functional.cc
334         $(CXXCOMPILE) -std=gnu++0x -c $<
335
336 hash_c++0x.lo: hash_c++0x.cc
337         $(LTCXXCOMPILE) -std=gnu++0x -c $<
338 hash_c++0x.o: hash_c++0x.cc
339         $(CXXCOMPILE) -std=gnu++0x -c $<
340
341 hashtable_c++0x.lo: hashtable_c++0x.cc
342         $(LTCXXCOMPILE) -std=gnu++0x -c $<
343 hashtable_c++0x.o: hashtable_c++0x.cc
344         $(CXXCOMPILE) -std=gnu++0x -c $<
345
346 limits.lo: limits.cc
347         $(LTCXXCOMPILE) -std=gnu++0x -c $<
348 limits.o: limits.cc
349         $(CXXCOMPILE) -std=gnu++0x -c $<
350
351 fstream-inst.lo: fstream-inst.cc
352         $(LTCXXCOMPILE) -std=gnu++0x -c $<
353 fstream-inst.o: fstream-inst.cc
354         $(CXXCOMPILE) -std=gnu++0x -c $<
355
356 string-inst.lo: string-inst.cc
357         $(LTCXXCOMPILE) -std=gnu++0x -c $<
358 string-inst.o: string-inst.cc
359         $(CXXCOMPILE) -std=gnu++0x -c $<
360
361 wstring-inst.lo: wstring-inst.cc
362         $(LTCXXCOMPILE) -std=gnu++0x -c $<
363 wstring-inst.o: wstring-inst.cc
364         $(CXXCOMPILE) -std=gnu++0x -c $<
365
366 chrono.lo: chrono.cc
367         $(LTCXXCOMPILE) -std=gnu++0x -c $<
368 chrono.o: chrono.cc
369         $(CXXCOMPILE) -std=gnu++0x -c $<
370
371 thread.lo: thread.cc
372         $(LTCXXCOMPILE) -std=gnu++0x -c $<
373 thread.o: thread.cc
374         $(CXXCOMPILE) -std=gnu++0x -c $<
375
376 future.lo: future.cc
377         $(LTCXXCOMPILE) -std=gnu++0x -c $<
378 future.o: future.cc
379         $(CXXCOMPILE) -std=gnu++0x -c $<
380
381 regex.lo: regex.cc
382         $(LTCXXCOMPILE) -std=gnu++0x -c $<
383 regex.o: regex.cc
384         $(CXXCOMPILE) -std=gnu++0x -c $<
385
386 debug.lo: debug.cc
387         $(LTCXXCOMPILE) -std=gnu++0x -c $<
388 debug.o: debug.cc
389         $(CXXCOMPILE) -std=gnu++0x -c $<
390
391 placeholders.lo: placeholders.cc
392         $(LTCXXCOMPILE) -std=gnu++0x -c $<
393 placeholders.o: placeholders.cc
394         $(CXXCOMPILE) -std=gnu++0x -c $<
395
396 if GLIBCXX_LDBL_COMPAT
397 # Use special rules for compatibility-ldbl.cc compilation, as we need to
398 # pass -mlong-double-64.
399 compatibility-ldbl.lo: compatibility-ldbl.cc
400         $(LTCXXCOMPILE) -mlong-double-64 -c $<
401 compatibility-ldbl.o: compatibility-ldbl.cc
402         $(CXXCOMPILE) -mlong-double-64 -c $<
403 endif
404
405 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
406 # modified in a per-library or per-sub-library way.  Need to manually
407 # set this option because CONFIG_CXXFLAGS has to be after
408 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
409 # as the occasion calls for it.
410 AM_CXXFLAGS = \
411         $(XTEMPLATE_FLAGS) \
412         $(WARN_CXXFLAGS) \
413         $(OPTIMIZE_CXXFLAGS) \
414         $(CONFIG_CXXFLAGS)
415
416
417 # libstdc++ libtool notes
418
419 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
420 # last. (That way, things like -O2 passed down from the toplevel can
421 # be overridden by --enable-debug.)
422
423 # 2) In general, libtool expects an argument such as `--tag=CXX' when
424 # using the C++ compiler, because that will enable the settings
425 # detected when C++ support was being configured.  However, when no
426 # such flag is given in the command line, libtool attempts to figure
427 # it out by matching the compiler name in each configuration section
428 # against a prefix of the command line.  The problem is that, if the
429 # compiler name and its initial flags stored in the libtool
430 # configuration file don't match those in the command line, libtool
431 # can't decide which configuration to use, and it gives up.  The
432 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
433 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
434 # attempt to infer which configuration to use
435 LTCXXCOMPILE = $(LIBTOOL) --tag CXX \
436                $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
437                $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
438                $(AM_CXXFLAGS) $(CXXFLAGS)
439
440 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
441
442 # 3) We'd have a problem when building the shared libstdc++ object if
443 # the rules automake generates would be used.  We cannot allow g++ to
444 # be used since this would add -lstdc++ to the link line which of
445 # course is problematic at this point.  So, we get the top-level
446 # directory to configure libstdc++-v3 to use gcc as the C++
447 # compilation driver.
448 CXXLINK = $(LIBTOOL) --tag CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
449           $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
450
451
452 # Added bits to build debug library.
453 if GLIBCXX_BUILD_DEBUG
454 all-local: build_debug
455 install-data-local: install_debug
456 else
457 all-local:
458 install-data-local:
459 endif
460
461 debugdir = debug
462
463 # Build a set of debug objects here.
464 # Take care to fix all possibly-relative paths.
465 stamp-debug:
466         if test ! -d ${debugdir}; then \
467           mkdir -p ${debugdir}; \
468           (cd ${debugdir}; \
469           sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
470               -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
471               -e 's/srcdir = \.\./srcdir = ..\/../' \
472               -e 's/VPATH = \.\./VPATH = ..\/../' \
473               -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
474               -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
475               -e 's/all-local: build_debug/all-local:/' \
476               -e 's/install-data-local: install_debug/install-data-local:/' \
477           < ../Makefile > Makefile) ; \
478         fi; \
479         echo `date` > stamp-debug;
480
481 build_debug: stamp-debug
482         (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' all)
483
484 # Install debug library here.
485 install_debug:
486         (cd ${debugdir} && $(MAKE) \
487         toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)