# Makefile.am

    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 include $(top_srcdir)/fragment.am
    00026
    00027 # Cross compiler support.
    00028 toolexeclib_LTLIBRARIES = libstdc++.la
    00029
    00030 # Symbol versioning for shared libraries.
    00031 if GLIBCXX_BUILD_VERSIONED_SHLIB
    00032 version_arg = -Wl,--version-script=libstdc++-symbol.ver
    00033 version_dep = libstdc++-symbol.ver
    00034 libstdc++-symbol.ver:  ${glibcxx_srcdir}/$(SYMVER_MAP)
    00035     cp ${glibcxx_srcdir}/$(SYMVER_MAP) ./libstdc++-symbol.ver
    00036     if test "x$(port_specific_symbol_files)" != x; then \
    00037       sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
    00038       sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
    00039       cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
    00040       rm tmp.top tmp.bottom; \
    00041     fi
    00042 else
    00043 version_arg =
    00044 version_dep =
    00045 endif
    00046
    00047
    00048 # Source files linked in via configuration/make substitution for a
    00049 # particular host.
    00050 host_sources = \
    00051     atomicity.cc \
    00052     codecvt_members.cc \
    00053     collate_members.cc \
    00054     ctype_members.cc \
    00055     messages_members.cc \
    00056     monetary_members.cc \
    00057     numeric_members.cc \
    00058     time_members.cc
    00059
    00060 codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
    00061     $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
    00062
    00063 collate_members.cc: ${glibcxx_srcdir}/$(CCOLLATE_CC)
    00064     $(LN_S) ${glibcxx_srcdir}/$(CCOLLATE_CC) . || true
    00065
    00066 ctype_members.cc: ${glibcxx_srcdir}/$(CCTYPE_CC)
    00067     $(LN_S) ${glibcxx_srcdir}/$(CCTYPE_CC) . || true
    00068
    00069 messages_members.cc: ${glibcxx_srcdir}/$(CMESSAGES_CC)
    00070     $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_CC) . || true
    00071
    00072 monetary_members.cc: ${glibcxx_srcdir}/$(CMONEY_CC)
    00073     $(LN_S) ${glibcxx_srcdir}/$(CMONEY_CC) . || true
    00074
    00075 numeric_members.cc: ${glibcxx_srcdir}/$(CNUMERIC_CC)
    00076     $(LN_S) ${glibcxx_srcdir}/$(CNUMERIC_CC) . || true
    00077
    00078 time_members.cc: ${glibcxx_srcdir}/$(CTIME_CC)
    00079     $(LN_S) ${glibcxx_srcdir}/$(CTIME_CC) . || true
    00080
    00081 atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
    00082 atomicity.cc: ${atomicity_file}
    00083     $(LN_S) ${atomicity_file} ./atomicity.cc || true
    00084
    00085 # Source files linked in via configuration/make substitution for a
    00086 # particular host, but with ad hoc naming rules.
    00087 host_sources_extra = \
    00088     basic_file.cc \
    00089     c++locale.cc
    00090
    00091 c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
    00092     $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
    00093
    00094 basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
    00095     $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true
    00096
    00097 # Sources present in the src directory.
    00098 sources = \
    00099     allocator.cc \
    00100     codecvt.cc \
    00101     complex_io.cc \
    00102     ctype.cc \
    00103     debug.cc \
    00104     debug_list.cc \
    00105     functexcept.cc \
    00106     globals_locale.cc \
    00107     globals_io.cc \
    00108     ios.cc \
    00109     ios_failure.cc \
    00110     ios_init.cc \
    00111     ios_locale.cc \
    00112     limits.cc \
    00113     list.cc \
    00114     locale.cc \
    00115     locale_init.cc \
    00116     locale_facets.cc \
    00117     localename.cc \
    00118     stdexcept.cc \
    00119     strstream.cc \
    00120     tree.cc \
    00121     allocator-inst.cc \
    00122     concept-inst.cc \
    00123     fstream-inst.cc \
    00124     ext-inst.cc \
    00125     io-inst.cc \
    00126     istream-inst.cc \
    00127     locale-inst.cc \
    00128     locale-misc-inst.cc \
    00129     misc-inst.cc \
    00130     ostream-inst.cc \
    00131     sstream-inst.cc \
    00132     streambuf-inst.cc \
    00133     string-inst.cc \
    00134     valarray-inst.cc \
    00135     wlocale-inst.cc \
    00136     wstring-inst.cc \
    00137     ${host_sources} \
    00138     ${host_sources_extra}
    00139
    00140 VPATH = $(top_srcdir)/src:$(top_srcdir)
    00141
    00142 libstdc___la_SOURCES = $(sources)
    00143
    00144 libstdc___la_LIBADD = \
    00145     $(top_builddir)/libmath/libmath.la \
    00146     $(top_builddir)/libsupc++/libsupc++convenience.la
    00147
    00148 libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
    00149
    00150 libstdc___la_LDFLAGS = \
    00151     -version-info $(libtool_VERSION) ${version_arg} -lm
    00152
    00153
    00154 # Use special rules for the deprecated source files so that they find
    00155 # deprecated include files.
    00156 GLIBCXX_INCLUDE_DIR=$(glibcxx_builddir)/include
    00157 strstream.lo: strstream.cc
    00158     $(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
    00159 strstream.o: strstream.cc
    00160     $(CXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $<
    00161
    00162 # Use special rules for the concept-checking instantiations so that all
    00163 # the generated template functions are also instantiated.  Force the checks
    00164 # to be on so that the instantiations are actually seen.
    00165 concept-inst.lo: concept-inst.cc
    00166     $(LTCXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
    00167 concept-inst.o: concept-inst.cc
    00168     $(CXXCOMPILE) -D_GLIBCXX_CONCEPT_CHECKS -fimplicit-templates -c $<
    00169
    00170 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
    00171 # modified in a per-library or per-sub-library way.  Need to manually
    00172 # set this option because CONFIG_CXXFLAGS has to be after
    00173 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
    00174 # as the occasion calls for it.
    00175 AM_CXXFLAGS = \
    00176     -fno-implicit-templates \
    00177     $(WARN_CXXFLAGS) \
    00178     $(OPTIMIZE_CXXFLAGS) \
    00179     $(CONFIG_CXXFLAGS)
    00180
    00181
    00182 # libstdc++ libtool notes
    00183
    00184 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
    00185 # last. (That way, things like -O2 passed down from the toplevel can
    00186 # be overridden by --enable-debug.)
    00187
    00188 # 2) In general, libtool expects an argument such as `--tag=CXX' when
    00189 # using the C++ compiler, because that will enable the settings
    00190 # detected when C++ support was being configured.  However, when no
    00191 # such flag is given in the command line, libtool attempts to figure
    00192 # it out by matching the compiler name in each configuration section
    00193 # against a prefix of the command line.  The problem is that, if the
    00194 # compiler name and its initial flags stored in the libtool
    00195 # configuration file don't match those in the command line, libtool
    00196 # can't decide which configuration to use, and it gives up.  The
    00197 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
    00198 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
    00199 # attempt to infer which configuration to use
    00200 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \
    00201            $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
    00202
    00203 # 3) We'd have a problem when building the shared libstdc++ object if
    00204 # the rules automake generates would be used.  We cannot allow g++ to
    00205 # be used since this would add -lstdc++ to the link line which of
    00206 # course is problematic at this point.  So, we get the top-level
    00207 # directory to configure libstdc++-v3 to use gcc as the C++
    00208 # compilation driver.
    00209 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \
    00210       $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
    00211
    00212
    00213 # Added bits to build debug library.
    00214 if GLIBCXX_BUILD_DEBUG
    00215 all-local: build_debug
    00216 install-data-local: install_debug
    00217 else
    00218 all-local:
    00219 install-data-local:
    00220 endif
    00221
    00222 debugdir = debug
    00223
    00224 # Build parallel set of debug objects here.
    00225 stamp-debug:
    00226     if test ! -d ${debugdir}; then \
    00227       mkdir -p ${debugdir}; \
    00228       (cd ${debugdir}; \
    00229       sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
    00230           -e 's/srcdir = \.\./srcdir = ..\/../' \
    00231           -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
    00232           -e 's/all-local: build_debug/all-local:/' \
    00233           -e 's/install-data-local: install_debug/install-data-local:/' \
    00234       < ../Makefile > Makefile) ; \
    00235     fi; \
    00236     echo `date` > stamp-debug;
    00237
    00238 build_debug: stamp-debug
    00239     (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' all)
    00240
    00241 # Install debug library here.
    00242 install_debug:
    00243     (cd ${debugdir} && $(MAKE) \
    00244     toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)