OSDN Git Service

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