* doc/gcov.texi: Use more logical markup.
[official-gcc.git] / libstdc++-v3 / src / Makefile.am
blob8ca4176d9f300d77c0f0eb67b75b8215d22803a7
1 ## Makefile for the src subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4 ##
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 2, or (at your option)
12 ## any later version.
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 COPYING.  If not, write to the Free
21 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 ## USA.
24 ## $Id: Makefile.am,v 1.86 2001/06/01 09:22:05 hp Exp $
26 AUTOMAKE_OPTIONS = 1.3 gnits
27 MAINT_CHARSET = latin1
29 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
31 # Cross compiler and multilib support.
32 CXX = @glibcpp_CXX@
33 toolexecdir = @glibcpp_toolexecdir@
34 toolexeclibdir = @glibcpp_toolexeclibdir@
35 toolexeclib_LTLIBRARIES = libstdc++.la
37 # Compile flags that should be constant throughout the build, both for
38 # SUBDIRS and for libstdc++-v3 in general.
39 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
41 # These bits are all figured out from configure. Look in acinclude.m4
42 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
43 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
44 CONFIG_CXXFLAGS = \
45         @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ 
47 # Warning flags to use.
48 WARN_CXXFLAGS = \
49         @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
51 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
52 GLIBCPP_INCLUDE_DIR = @GLIBCPP_INCLUDE_DIR@
53 C_INCLUDE_DIR = @C_INCLUDE_DIR@
54 CSTD_INCLUDES = @CSTD_INCLUDES@
55 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
56 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
57 LIBIO_INCLUDES = @LIBIO_INCLUDES@
58 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
60 INCLUDES = \
61         -nostdinc++ \
62         -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
63         $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
64         $(TOPLEVEL_INCLUDES)
66 base_headers = \
67         bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
68         bits/stringfwd.h bits/std_string.h bits/basic_string.h \
69         bits/basic_string.tcc \
70         bits/generic_shadow.h bits/std_utility.h \
71         bits/std_complex.h \
72         bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
73         bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
74         bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
75         bits/std_fstream.h bits/std_iomanip.h \
76         bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
77         bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
78         bits/std_istream.h bits/istream.tcc bits/std_locale.h \
79         bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc \
80         bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h \
81         bits/streambuf.tcc bits/basic_file.h \
82         bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
83         bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
84         bits/stl_threads.h \
85         bits/stl_iterator_base_types.h bits/stl_iterator_base_funcs.h \
86         bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
87         bits/std_iterator.h bits/std_list.h \
88         bits/std_map.h bits/std_memory.h bits/std_numeric.h \
89         bits/std_queue.h bits/std_set.h bits/std_stack.h \
90         bits/std_stdexcept.h bits/functexcept.h bits/std_vector.h \
91         bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
92         bits/stl_deque.h bits/stl_function.h \
93         bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
94         bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
95         bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
96         bits/stl_relops.h bits/stl_set.h bits/stl_stack.h bits/stl_tempbuf.h \
97         bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
98         bits/stl_bvector.h bits/type_traits.h bits/std_algorithm.h \
99         bits/stl_construct.h bits/boost_concept_check.h bits/concept_check.h
102 backward_headers = \
103         backward/complex.h backward/iomanip.h backward/istream.h \
104         backward/ostream.h backward/stream.h backward/streambuf.h \
105         backward/algo.h backward/algobase.h backward/alloc.h \
106         backward/bvector.h backward/defalloc.h backward/deque.h \
107         backward/function.h backward/hash_map.h backward/hash_set.h \
108         backward/hashtable.h backward/heap.h backward/iostream.h \
109         backward/iterator.h backward/list.h backward/map.h \
110         backward/multimap.h backward/new.h backward/multiset.h \
111         backward/pair.h backward/queue.h backward/rope.h backward/set.h \
112         backward/slist.h backward/stack.h backward/tempbuf.h backward/tree.h \
113         backward/vector.h backward/fstream.h backward/strstream.h \
114         backward/strstream backward/backward_warning.h
116 ext_headers = \
117         ext/rope ext/ropeimpl.h ext/stl_rope.h \
118         ext/slist ext/hash_map ext/hash_set \
119         ext/stl_hashtable.h ext/stl_hash_fun.h 
121 c_base_headers = \
122         bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h \
123         bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h \
124         bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h \
125         bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h \
126         bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h \
127         bits/std_cwchar.h bits/std_cwctype.h bits/cmath.tcc
129 if GLIBCPP_USE_CSHADOW
130 c_shadow_headers = \
131         assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \
132         signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \
133         wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h \
134         features.h langinfo.h \
135         bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h \
136         bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \
137         bits/wrap_features.h bits/wrap_langinfo.h \
138         sys/cdefs.h 
139 else
140 c_shadow_headers =
141 endif
143 std_headers = \
144         algorithm bitset complex deque fstream functional \
145         iomanip ios iosfwd iostream istream iterator limits list locale \
146         map memory numeric ostream queue set sstream stack stdexcept \
147         streambuf string utility valarray vector \
148         cassert cctype cerrno cfloat climits clocale ciso646 \
149         cmath csetjmp csignal cstdarg cstddef cstdio cstdlib \
150         cstring ctime cwchar cwctype
152 if GLIBCPP_NEED_LIBIO 
153 libio_headers = \
154         $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
155 else
156 libio_headers =
157 endif
159 build_headers = \
160         bits/std_limits.h \
161         bits/c++config.h bits/c++io.h bits/c++locale.h \
162         bits/gthr.h bits/gthr-single.h bits/gthr-default.h \
163         bits/basic_file_model.h \
164         bits/atomicity.h bits/os_defines.h \
165         bits/ctype_base.h bits/ctype_noninline.h bits/ctype_inline.h 
167 sources = \
168         limitsMEMBERS.cc \
169         stdexcept.cc functexcept.cc bitset.cc \
170         globals.cc \
171         basic_file.cc ios.cc complex_io.cc strstream.cc \
172         c++locale.cc locale.cc localename.cc codecvt.cc \
173         locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc \
174         string-inst.cc wstring-inst.cc 
177 VPATH = $(top_srcdir):$(top_srcdir)/src:$(GLIBCPP_INCLUDE_DIR):$(GLIBCPP_INCLUDE_DIR)/std:$(C_INCLUDE_DIR)
179 libstdc___la_SOURCES = $(sources)
181 libstdc___la_LIBADD = \
182         ../libmath/libmath.la @libio_la@ \
183         ../libsupc++/libsupc++convenience.la
185 libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
187 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
190 # Use special rules for the deprecated source files so that they find
191 # deprecated include files.
192 strstream.lo: strstream.cc
193         $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
194 strstream.o: strstream.cc
195         $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
197 # Make sure cshadow headers are built first.
198 if GLIBCPP_USE_CSHADOW
199 CSHADOW_H = $(top_builddir)/stamp-cshadow
200 else
201 CSHADOW_H =
202 endif
204 # Specify that all *.o's depend on this.
205 $(libstdc___la_OBJECTS): $(CSHADOW_H)
207 $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
208                                $(top_srcdir)/mkcshadow
209         $(top_srcdir)/mkinclosure \
210         "-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
211         rm -f  $(top_builddir)/stamp-cshadow 
212         echo "done" > $(top_builddir)/stamp-cshadow 
215 # Check for various configure bits that change where the headers get installed.
216 gxx_include_dir = @gxx_include_dir@
217 gxx_target_include_dir = $(gxx_include_dir)/$(target_alias)
219 # We have our own special, ridiculously complicated installation routine
220 # here, as automake/autoconf is currently brain-damaged when it comes
221 # to installing sub-directories of headers. In particular, we want to
222 # 1) install build headers from (blddir)/include/bits -> (install)/bits
223 # 2) install source headers from
224 #      (srcdir)/include/bits -> (install)/bits
225 #      (srcdir)/include/ext -> (install)/ext
226 #      (srcdir)/include/backward -> (install)/backward
227 #      ... and the always entertaining "C" compatibility bits
228 #      where * represents configure-time directory switching
229 #      (srcdir)/include/c* -> (install)/
230 #      (srcdir)/include/c*/bits -> (install)/bits
231 #      (srcdir)/include/c*/sys -> (install)/sys
232 install-data-local: myinstalldirs myinstallheaders
234 # NB: installation of shadow header directories is not attempted.
235 myinstalldirs:
236         if test -z "$(MULTISUBDIR)"; then \
237         $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/backward; \
238         $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/bits; \
239         $(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/ext; \
240         $(mkinstalldirs) $(DESTDIR)$(gxx_target_include_dir)/bits; \
241         fi
243 # NB: As libio_headers may be empty, need this to make sure bash doesn't
244 # choke on an empty for... loop by using libio_headers_install
245 # NB: installation of shadow headers is not attempted.
246 src_incdir = @GLIBCPP_INCLUDE_DIR@
247 bld_incdir = $(top_builddir)/include
248 c_incdir = @C_INCLUDE_DIR@
249 myinstallheaders: 
250         if test -z "$(MULTISUBDIR)"; then \
251         for i in $(base_headers); do \
252         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/";\
253           $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/; \
254         done; \
255         for i in $(ext_headers); do \
256         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/";\
257           $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/; \
258         done; \
259         for i in $(backward_headers); do \
260         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/backward/";\
261           $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/backward/; \
262         done; \
263         for i in $(c_base_headers); do \
264         echo "$(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/";\
265           $(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/; \
266         done; \
267         for i in $(std_headers); do \
268         echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir)";\
269           $(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir); \
270         done; \
271         for i in $(build_headers); do \
272         echo "$(INSTALL_DATA) $(bld_incdir)/$$i \
273           $(gxx_target_include_dir)/bits/"; $(INSTALL_DATA) \
274           $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/; \
275         done; \
276         libio_headers_install='$(libio_headers)'; \
277         for i in $$libio_headers_install; do \
278         echo "$(INSTALL_DATA) $$i $(gxx_include_dir)"; \
279           $(INSTALL_DATA) $$i $(gxx_include_dir); \
280         done; \
281         fi;
284 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
285 # modified in a per-library or per-sub-library way.  Need to manually
286 # set this option because CONFIG_CXXFLAGS has to be after
287 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
288 # as the occasion call for it. (ie, --enable-debug)
290 # The no-implicit-templates flag will generate unresolved references to
291 # the concept-checking symbols.  So we must disable the checks while
292 # actually building the library.
293 AM_CXXFLAGS = \
294         -fno-implicit-templates \
295         $(LIBSUPCXX_CXXFLAGS) \
296         $(WARN_CXXFLAGS) \
297         $(OPTIMIZE_CXXFLAGS) \
298         $(CONFIG_CXXFLAGS) 
301 # libstdc++ libtool notes
303 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
304 # last. (That way, things like -O2 passed down from the toplevel can
305 # be overridden by --enable-debug.)
307 # 2) In general, libtool expects an argument such as `--tag=CXX' when
308 # using the C++ compiler, because that will enable the settings
309 # detected when C++ support was being configured.  However, when no
310 # such flag is given in the command line, libtool attempts to figure
311 # it out by matching the compiler name in each configuration section
312 # against a prefix of the command line.  The problem is that, if the
313 # compiler name and its initial flags stored in the libtool
314 # configuration file don't match those in the command line, libtool
315 # can't decide which configuration to use, and it gives up.  The
316 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
317 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
318 # attempt to infer which configuration to use
319 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
320                $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
322 # 3) We'd have a problem when building the shared libstdc++ object if
323 # the rules automake generates would be used.  We cannot allow g++ to
324 # be used since this would add -lstdc++ to the link line which of
325 # course is problematic at this point.  So, we get the top-level
326 # directory to configure libstdc++-v3 to use gcc as the C++
327 # compilation driver.
328 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
329           @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@