1 ## Makefile for the src subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
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)
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,
24 ## $Id: Makefile.am,v 1.94 2001/08/14 01:24:30 bkoz Exp $
26 AUTOMAKE_OPTIONS = 1.3 gnits
27 MAINT_CHARSET = latin1
29 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
31 # Cross compiler and multilib support.
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.
45 @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
47 # Warning flags to use.
49 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
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@
61 $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
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 \
68 messages.cc collate.cc \
69 misc-inst.cc stdexcept.cc stl-inst.cc string-inst.cc strstream.cc \
70 valarray-inst.cc wstring-inst.cc
72 VPATH = $(top_srcdir):$(top_srcdir)/src
74 libstdc___la_SOURCES = $(sources)
76 libstdc___la_LIBADD = \
77 ../libmath/libmath.la @libio_la@ \
78 ../libsupc++/libsupc++convenience.la
80 libstdc___la_LDFLAGS = -version-info @libtool_VERSION@ -lm
82 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
85 # Use special rules for the deprecated source files so that they find
86 # deprecated include files.
87 GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
88 strstream.lo: strstream.cc
89 $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
90 strstream.o: strstream.cc
91 $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $<
94 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
95 # modified in a per-library or per-sub-library way. Need to manually
96 # set this option because CONFIG_CXXFLAGS has to be after
97 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
98 # as the occasion call for it. (ie, --enable-debug)
100 # The no-implicit-templates flag will generate unresolved references to
101 # the concept-checking symbols. So we must disable the checks while
102 # actually building the library.
104 -fno-implicit-templates \
105 $(LIBSUPCXX_CXXFLAGS) \
107 $(OPTIMIZE_CXXFLAGS) \
111 # libstdc++ libtool notes
113 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
114 # last. (That way, things like -O2 passed down from the toplevel can
115 # be overridden by --enable-debug.)
117 # 2) In general, libtool expects an argument such as `--tag=CXX' when
118 # using the C++ compiler, because that will enable the settings
119 # detected when C++ support was being configured. However, when no
120 # such flag is given in the command line, libtool attempts to figure
121 # it out by matching the compiler name in each configuration section
122 # against a prefix of the command line. The problem is that, if the
123 # compiler name and its initial flags stored in the libtool
124 # configuration file don't match those in the command line, libtool
125 # can't decide which configuration to use, and it gives up. The
126 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
127 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
128 # attempt to infer which configuration to use
129 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
130 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
132 # 3) We'd have a problem when building the shared libstdc++ object if
133 # the rules automake generates would be used. We cannot allow g++ to
134 # be used since this would add -lstdc++ to the link line which of
135 # course is problematic at this point. So, we get the top-level
136 # directory to configure libstdc++-v3 to use gcc as the C++
137 # compilation driver.
138 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
139 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@