OSDN Git Service

* include/Makefile.am: Remove RCS Id strings.
[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 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.
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 2, 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 COPYING.  If not, write to the Free
21 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 ## USA.
23
24 AUTOMAKE_OPTIONS = 1.3 gnits
25 MAINT_CHARSET = latin1
26
27 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
28
29 # Cross compiler and multilib support.
30 CXX = @glibcpp_CXX@
31 toolexecdir = @glibcpp_toolexecdir@
32 toolexeclibdir = @glibcpp_toolexeclibdir@
33 toolexeclib_LTLIBRARIES = libstdc++.la
34
35 # Compile flags that should be constant throughout the build, both for
36 # SUBDIRS and for libstdc++-v3 in general.
37 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
38
39 # These bits are all figured out from configure. Look in acinclude.m4
40 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
41 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
42 CONFIG_CXXFLAGS = \
43         @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ 
44
45 # Warning flags to use.
46 WARN_CXXFLAGS = \
47         @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
48
49 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
50 GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
51 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
52 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
53 LIBIO_INCLUDES = @LIBIO_INCLUDES@
54 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
55
56 INCLUDES = \
57         -nostdinc++ \
58         $(GLIBCPP_INCLUDES) \
59         $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
60         $(TOPLEVEL_INCLUDES)
61
62 sources = \
63         basic_file.cc bitset.cc c++locale.cc cmath.cc codecvt.cc \
64         complex_io.cc functexcept.cc globals.cc ios.cc limits.cc \
65         locale.cc locale-inst.cc localename.cc \
66         collate.cc messages.cc moneypunct.cc numpunct.cc \
67         misc-inst.cc stdexcept.cc stl-inst.cc string-inst.cc strstream.cc \
68         valarray-inst.cc wstring-inst.cc
69
70 VPATH = $(top_srcdir):$(top_srcdir)/src
71
72 libstdc___la_SOURCES = $(sources)
73
74 libstdc___la_LIBADD = \
75         ../libmath/libmath.la @libio_la@ \
76         ../libsupc++/libsupc++convenience.la
77
78 libstdc___la_LDFLAGS = -version-info @libtool_VERSION@ -lm
79
80 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
81
82
83 # Use special rules for the deprecated source files so that they find
84 # deprecated include files.
85 GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
86 strstream.lo: strstream.cc
87         $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
88 strstream.o: strstream.cc
89         $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
90
91
92 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
93 # modified in a per-library or per-sub-library way.  Need to manually
94 # set this option because CONFIG_CXXFLAGS has to be after
95 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
96 # as the occasion call for it. (ie, --enable-debug)
97 #
98 # The no-implicit-templates flag will generate unresolved references to
99 # the concept-checking symbols.  So we must disable the checks while
100 # actually building the library.
101 AM_CXXFLAGS = \
102         -fno-implicit-templates \
103         $(LIBSUPCXX_CXXFLAGS) \
104         $(WARN_CXXFLAGS) \
105         $(OPTIMIZE_CXXFLAGS) \
106         $(CONFIG_CXXFLAGS) 
107
108
109 # libstdc++ libtool notes
110
111 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
112 # last. (That way, things like -O2 passed down from the toplevel can
113 # be overridden by --enable-debug.)
114
115 # 2) In general, libtool expects an argument such as `--tag=CXX' when
116 # using the C++ compiler, because that will enable the settings
117 # detected when C++ support was being configured.  However, when no
118 # such flag is given in the command line, libtool attempts to figure
119 # it out by matching the compiler name in each configuration section
120 # against a prefix of the command line.  The problem is that, if the
121 # compiler name and its initial flags stored in the libtool
122 # configuration file don't match those in the command line, libtool
123 # can't decide which configuration to use, and it gives up.  The
124 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
125 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
126 # attempt to infer which configuration to use
127 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
128                $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
129
130 # 3) We'd have a problem when building the shared libstdc++ object if
131 # the rules automake generates would be used.  We cannot allow g++ to
132 # be used since this would add -lstdc++ to the link line which of
133 # course is problematic at this point.  So, we get the top-level
134 # directory to configure libstdc++-v3 to use gcc as the C++
135 # compilation driver.
136 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
137           @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@