1 ## Makefile for the src subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
4 ## Free Software Foundation, Inc.
6 ## This file is part of the libstdc++ version 3 distribution.
7 ## Process this file with automake to produce Makefile.in.
9 ## This file is part of the GNU ISO C++ Library. This library is free
10 ## software; you can redistribute it and/or modify it under the
11 ## terms of the GNU General Public License as published by the
12 ## Free Software Foundation; either version 2, or (at your option)
15 ## This library is distributed in the hope that it will be useful,
16 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ## GNU General Public License for more details.
20 ## You should have received a copy of the GNU General Public License along
21 ## with this library; see the file COPYING. If not, write to the Free
22 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 AUTOMAKE_OPTIONS = 1.3 gnits
26 MAINT_CHARSET = latin1
28 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
30 # Cross compiler and multilib support.
32 toolexecdir = @glibcpp_toolexecdir@
33 toolexeclibdir = @glibcpp_toolexeclibdir@
34 toolexeclib_LTLIBRARIES = libstdc++.la
36 # Compile flags that should be constant throughout the build, both for
37 # SUBDIRS and for libstdc++-v3 in general.
38 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
40 # These bits are all figured out from configure. Look in acinclude.m4
41 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
42 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
44 @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
46 # Warning flags to use.
48 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
50 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
51 GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
52 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
53 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
54 LIBIO_INCLUDES = @LIBIO_INCLUDES@
55 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
60 $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
64 globals.cc limits.cc \
65 basic_file.cc complex_io.cc ios.cc strstream.cc \
67 functexcept.cc stdexcept.cc vterminate.cc \
68 c++locale.cc locale.cc localename.cc codecvt.cc \
69 collate.cc ctype.cc messages.cc monetary.cc numeric.cc time.cc \
70 concept-inst.cc locale-inst.cc misc-inst.cc stl-inst.cc \
71 string-inst.cc wstring-inst.cc valarray-inst.cc ext-inst.cc
73 VPATH = $(top_srcdir)/src:$(top_srcdir)
75 libstdc___la_SOURCES = $(sources)
77 libstdc___la_LIBADD = \
78 ../libmath/libmath.la @libio_la@ \
79 ../libsupc++/libsupc++convenience.la
81 if GLIBCPP_BUILD_VERSIONED_SHLIB
82 version_arg=-Wl,--version-script=linker.map
87 libstdc___la_LDFLAGS = -version-info @libtool_VERSION@ -lm ${version_arg}
89 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) linker.map
91 # Use special rules for the deprecated source files so that they find
92 # deprecated include files.
93 GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
94 strstream.lo: strstream.cc
95 $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
96 strstream.o: strstream.cc
97 $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
99 # Use special rules for the concept-checking instantiations so that all
100 # the generated template functions are also instantiated. Force the checks
101 # to be on so that the instantiations are actually seen.
102 concept-inst.lo: concept-inst.cc
103 $(LTCXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
104 concept-inst.o: concept-inst.cc
105 $(CXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
108 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
109 # modified in a per-library or per-sub-library way. Need to manually
110 # set this option because CONFIG_CXXFLAGS has to be after
111 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
112 # as the occasion call for it. (ie, --enable-debug)
114 -fno-implicit-templates \
115 $(LIBSUPCXX_CXXFLAGS) \
117 $(OPTIMIZE_CXXFLAGS) \
121 # libstdc++ libtool notes
123 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
124 # last. (That way, things like -O2 passed down from the toplevel can
125 # be overridden by --enable-debug.)
127 # 2) In general, libtool expects an argument such as `--tag=CXX' when
128 # using the C++ compiler, because that will enable the settings
129 # detected when C++ support was being configured. However, when no
130 # such flag is given in the command line, libtool attempts to figure
131 # it out by matching the compiler name in each configuration section
132 # against a prefix of the command line. The problem is that, if the
133 # compiler name and its initial flags stored in the libtool
134 # configuration file don't match those in the command line, libtool
135 # can't decide which configuration to use, and it gives up. The
136 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
137 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
138 # attempt to infer which configuration to use
139 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
140 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
142 # 3) We'd have a problem when building the shared libstdc++ object if
143 # the rules automake generates would be used. We cannot allow g++ to
144 # be used since this would add -lstdc++ to the link line which of
145 # course is problematic at this point. So, we get the top-level
146 # directory to configure libstdc++-v3 to use gcc as the C++
147 # compilation driver.
148 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
149 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@