00001 ## Makefile for the src subdirectory of the GNU C++ Standard library.
00002 ##
00003 ## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
00004 ## Free Software Foundation, Inc.
00005 ##
00006 ## This file is part of the libstdc++ version 3 distribution.
00007 ## Process this file with automake to produce Makefile.in.
00008
00009 ## This file is part of the GNU ISO C++ Library. This library is free
00010 ## software; you can redistribute it and/or modify it under the
00011 ## terms of the GNU General Public License as published by the
00012 ## Free Software Foundation; either version 2, or (at your option)
00013 ## any later version.
00014
00015 ## This library is distributed in the hope that it will be useful,
00016 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018 ## GNU General Public License for more details.
00019
00020 ## You should have received a copy of the GNU General Public License along
00021 ## with this library; see the file COPYING. If not, write to the Free
00022 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00023 ## USA.
00024
00025 AUTOMAKE_OPTIONS = 1.3 cygnus
00026 MAINT_CHARSET = latin1
00027
00028 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
00029
00030 # Cross compiler support.
00031 CXX = @glibcpp_CXX@
00032 glibcpp_srcdir=@glibcpp_srcdir@
00033 glibcpp_builddir=@glibcpp_builddir@
00034 toolexecdir = @glibcpp_toolexecdir@
00035 toolexeclibdir = @glibcpp_toolexeclibdir@
00036 toolexeclib_LTLIBRARIES = libstdc++.la
00037
00038 # Symbol versioning for shared libraries.
00039 if GLIBCPP_BUILD_VERSIONED_SHLIB
00040 version_arg = -Wl,--version-script=libstdc++-symbol.ver
00041 version_dep = libstdc++-symbol.ver
00042 libstdc++-symbol.ver: ${glibcpp_srcdir}/@SYMVER_MAP@
00043 @LN_S@ ${glibcpp_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver || true
00044 else
00045 version_arg =
00046 version_dep =
00047 endif
00048
00049 # Compile flags that should be constant throughout the build, both for
00050 # SUBDIRS and for libstdc++-v3 in general.
00051 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
00052
00053 # These bits are all figured out from configure. Look in acinclude.m4
00054 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
00055 CONFIG_CXXFLAGS = \
00056 @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
00057
00058 # Warning flags to use.
00059 WARN_CXXFLAGS = \
00060 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
00061
00062 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
00063 GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
00064 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@
00065 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
00066 LIBIO_INCLUDES = @LIBIO_INCLUDES@
00067 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
00068
00069 INCLUDES = \
00070 -nostdinc++ \
00071 $(GLIBCPP_INCLUDES) \
00072 $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \
00073 $(TOPLEVEL_INCLUDES)
00074
00075 # Source files linked in via configuration/make substitution for a
00076 # particular target.
00077 target_sources = \
00078 codecvt_members.cc \
00079 collate_members.cc \
00080 ctype_members.cc \
00081 messages_members.cc \
00082 monetary_members.cc \
00083 numeric_members.cc \
00084 time_members.cc
00085
00086 codecvt_members.cc: ${glibcpp_srcdir}/@CCODECVT_CC@
00087 @LN_S@ ${glibcpp_srcdir}/@CCODECVT_CC@ . || true
00088
00089 collate_members.cc: ${glibcpp_srcdir}/@CCOLLATE_CC@
00090 @LN_S@ ${glibcpp_srcdir}/@CCOLLATE_CC@ . || true
00091
00092 ctype_members.cc: ${glibcpp_srcdir}/@CCTYPE_CC@
00093 @LN_S@ ${glibcpp_srcdir}/@CCTYPE_CC@ . || true
00094
00095 messages_members.cc: ${glibcpp_srcdir}/@CMESSAGES_CC@
00096 @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_CC@ . || true
00097
00098 monetary_members.cc: ${glibcpp_srcdir}/@CMONEY_CC@
00099 @LN_S@ ${glibcpp_srcdir}/@CMONEY_CC@ . || true
00100
00101 numeric_members.cc: ${glibcpp_srcdir}/@CNUMERIC_CC@
00102 @LN_S@ ${glibcpp_srcdir}/@CNUMERIC_CC@ . || true
00103
00104 time_members.cc: ${glibcpp_srcdir}/@CTIME_CC@
00105 @LN_S@ ${glibcpp_srcdir}/@CTIME_CC@ . || true
00106
00107 # Source files linked in via configuration/make substitution for a
00108 # particular target, but with ad hoc naming rules.
00109 target_sources_extra = \
00110 basic_file.cc \
00111 c++locale.cc
00112
00113 c++locale.cc: ${glibcpp_srcdir}/@CLOCALE_CC@
00114 @LN_S@ ${glibcpp_srcdir}/@CLOCALE_CC@ ./$@ || true
00115
00116 basic_file.cc: ${glibcpp_srcdir}/@BASIC_FILE_CC@
00117 @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_CC@ ./$@ || true
00118
00119 # Sources present in the src directory.
00120 sources = \
00121 bitset.cc \
00122 codecvt.cc \
00123 complex_io.cc \
00124 concept-inst.cc \
00125 ctype.cc \
00126 ext-inst.cc \
00127 fstream.cc \
00128 fstream-inst.cc \
00129 functexcept.cc \
00130 globals.cc \
00131 io-inst.cc \
00132 ios.cc \
00133 istream-inst.cc \
00134 limits.cc \
00135 locale.cc \
00136 locale-inst.cc \
00137 localename.cc \
00138 misc-inst.cc \
00139 ostream-inst.cc \
00140 sstream-inst.cc \
00141 stdexcept.cc \
00142 stl-inst.cc \
00143 streambuf-inst.cc \
00144 string-inst.cc \
00145 strstream.cc \
00146 valarray-inst.cc \
00147 vterminate.cc \
00148 wstring-inst.cc \
00149 ${target_sources} \
00150 ${target_sources_extra}
00151
00152 VPATH = $(top_srcdir)/src:$(top_srcdir)
00153
00154 libstdc___la_SOURCES = $(sources)
00155
00156 libstdc___la_LIBADD = \
00157 $(top_builddir)/libmath/libmath.la @libio_la@ \
00158 $(top_builddir)/libsupc++/libsupc++convenience.la
00159
00160 libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
00161
00162 libstdc___la_LDFLAGS = \
00163 -version-info @libtool_VERSION@ ${version_arg} \
00164 -lm @LIBUNWIND_FLAG@
00165
00166
00167 # Use special rules for the deprecated source files so that they find
00168 # deprecated include files.
00169 GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include
00170 strstream.lo: strstream.cc
00171 $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
00172 strstream.o: strstream.cc
00173 $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $<
00174
00175 # Use special rules for the concept-checking instantiations so that all
00176 # the generated template functions are also instantiated. Force the checks
00177 # to be on so that the instantiations are actually seen.
00178 concept-inst.lo: concept-inst.cc
00179 $(LTCXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
00180 concept-inst.o: concept-inst.cc
00181 $(CXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $<
00182
00183
00184 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
00185 # modified in a per-library or per-sub-library way. Need to manually
00186 # set this option because CONFIG_CXXFLAGS has to be after
00187 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
00188 # as the occasion call for it.
00189 AM_CXXFLAGS = \
00190 -fno-implicit-templates \
00191 $(LIBSUPCXX_CXXFLAGS) \
00192 $(WARN_CXXFLAGS) \
00193 $(OPTIMIZE_CXXFLAGS) \
00194 $(CONFIG_CXXFLAGS)
00195
00196
00197 # libstdc++ libtool notes
00198
00199 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
00200 # last. (That way, things like -O2 passed down from the toplevel can
00201 # be overridden by --enable-debug.)
00202
00203 # 2) In general, libtool expects an argument such as `--tag=CXX' when
00204 # using the C++ compiler, because that will enable the settings
00205 # detected when C++ support was being configured. However, when no
00206 # such flag is given in the command line, libtool attempts to figure
00207 # it out by matching the compiler name in each configuration section
00208 # against a prefix of the command line. The problem is that, if the
00209 # compiler name and its initial flags stored in the libtool
00210 # configuration file don't match those in the command line, libtool
00211 # can't decide which configuration to use, and it gives up. The
00212 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
00213 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
00214 # attempt to infer which configuration to use
00215 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
00216 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
00217
00218 # 3) We'd have a problem when building the shared libstdc++ object if
00219 # the rules automake generates would be used. We cannot allow g++ to
00220 # be used since this would add -lstdc++ to the link line which of
00221 # course is problematic at this point. So, we get the top-level
00222 # directory to configure libstdc++-v3 to use gcc as the C++
00223 # compilation driver.
00224 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
00225 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
00226
00227
00228 # Added bits to build debug library.
00229 if GLIBCPP_BUILD_DEBUG
00230 all-local: build_debug
00231 install-data-local: install_debug
00232 else
00233 all-local:
00234 install-data-local:
00235 endif
00236
00237 debugdir = debug
00238
00239 # Build parallel set of debug objects here.
00240 stamp-debug:
00241 if test ! -d ${debugdir}; then \
00242 mkdir -p ${debugdir}; \
00243 (cd ${debugdir}; \
00244 sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
00245 -e 's/srcdir = \.\./srcdir = ..\/../' \
00246 -e 's/glibcpp_basedir = \.\./glibcpp_basedir = ..\/../' \
00247 -e 's/all-local: build_debug/all-local:/' \
00248 -e 's/install-data-local: install_debug/install-data-local:/' \
00249 < ../Makefile > Makefile) ; \
00250 fi; \
00251 echo `date` > stamp-debug;
00252
00253 build_debug: stamp-debug
00254 (cd ${debugdir} && $(MAKE) CXXFLAGS='@DEBUG_FLAGS@' all)
00255
00256 # Install debug library here.
00257 install_debug:
00258 (cd ${debugdir} && $(MAKE) \
00259 toolexeclibdir=@glibcpp_toolexeclibdir@/debug install)