00001 ## Makefile for the src subdirectory of the GNU C++ Standard library. 00002 ## 00003 ## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 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 gnits 00026 MAINT_CHARSET = latin1 00027 00028 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs 00029 00030 # Cross compiler and multilib support. 00031 CXX = @glibcpp_CXX@ 00032 toolexecdir = @glibcpp_toolexecdir@ 00033 toolexeclibdir = @glibcpp_toolexeclibdir@ 00034 toolexeclib_LTLIBRARIES = libstdc++.la 00035 00036 # Compile flags that should be constant throughout the build, both for 00037 # SUBDIRS and for libstdc++-v3 in general. 00038 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ 00039 00040 # These bits are all figured out from configure. Look in acinclude.m4 00041 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS 00042 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. 00043 CONFIG_CXXFLAGS = \ 00044 @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ 00045 00046 # Warning flags to use. 00047 WARN_CXXFLAGS = \ 00048 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once 00049 00050 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES 00051 GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@ 00052 LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ 00053 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ 00054 LIBIO_INCLUDES = @LIBIO_INCLUDES@ 00055 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ 00056 00057 INCLUDES = \ 00058 -nostdinc++ \ 00059 $(GLIBCPP_INCLUDES) \ 00060 $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \ 00061 $(TOPLEVEL_INCLUDES) 00062 00063 sources = \ 00064 globals.cc limits.cc \ 00065 basic_file.cc complex_io.cc ios.cc strstream.cc \ 00066 cmath.cc bitset.cc \ 00067 functexcept.cc stdexcept.cc vterminate.cc \ 00068 c++locale.cc locale.cc localename.cc codecvt.cc \ 00069 collate.cc ctype.cc messages.cc monetary.cc numeric.cc time.cc \ 00070 concept-inst.cc locale-inst.cc misc-inst.cc stl-inst.cc \ 00071 string-inst.cc wstring-inst.cc valarray-inst.cc ext-inst.cc 00072 00073 VPATH = $(top_srcdir)/src:$(top_srcdir) 00074 00075 libstdc___la_SOURCES = $(sources) 00076 00077 libstdc___la_LIBADD = \ 00078 ../libmath/libmath.la @libio_la@ \ 00079 ../libsupc++/libsupc++convenience.la 00080 00081 if GLIBCPP_BUILD_VERSIONED_SHLIB 00082 version_arg=-Wl,--version-script=linker.map 00083 else 00084 version_arg= 00085 endif 00086 00087 libstdc___la_LDFLAGS = \ 00088 -version-info @libtool_VERSION@ ${version_arg} \ 00089 -lm @LIBUNWIND_FLAG@ 00090 00091 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) linker.map 00092 00093 # Use special rules for the deprecated source files so that they find 00094 # deprecated include files. 00095 GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include 00096 strstream.lo: strstream.cc 00097 $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $< 00098 strstream.o: strstream.cc 00099 $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -Wno-deprecated -c $< 00100 00101 # Use special rules for the concept-checking instantiations so that all 00102 # the generated template functions are also instantiated. Force the checks 00103 # to be on so that the instantiations are actually seen. 00104 concept-inst.lo: concept-inst.cc 00105 $(LTCXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $< 00106 concept-inst.o: concept-inst.cc 00107 $(CXXCOMPILE) -D_GLIBCPP_CONCEPT_CHECKS -fimplicit-templates -c $< 00108 00109 00110 # AM_CXXFLAGS needs to be in each subdirectory so that it can be 00111 # modified in a per-library or per-sub-library way. Need to manually 00112 # set this option because CONFIG_CXXFLAGS has to be after 00113 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden 00114 # as the occasion call for it. (ie, --enable-debug) 00115 AM_CXXFLAGS = \ 00116 -fno-implicit-templates \ 00117 $(LIBSUPCXX_CXXFLAGS) \ 00118 $(WARN_CXXFLAGS) \ 00119 $(OPTIMIZE_CXXFLAGS) \ 00120 $(CONFIG_CXXFLAGS) 00121 00122 00123 # libstdc++ libtool notes 00124 00125 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is 00126 # last. (That way, things like -O2 passed down from the toplevel can 00127 # be overridden by --enable-debug.) 00128 00129 # 2) In general, libtool expects an argument such as `--tag=CXX' when 00130 # using the C++ compiler, because that will enable the settings 00131 # detected when C++ support was being configured. However, when no 00132 # such flag is given in the command line, libtool attempts to figure 00133 # it out by matching the compiler name in each configuration section 00134 # against a prefix of the command line. The problem is that, if the 00135 # compiler name and its initial flags stored in the libtool 00136 # configuration file don't match those in the command line, libtool 00137 # can't decide which configuration to use, and it gives up. The 00138 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe 00139 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to 00140 # attempt to infer which configuration to use 00141 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \ 00142 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 00143 00144 # 3) We'd have a problem when building the shared libstdc++ object if 00145 # the rules automake generates would be used. We cannot allow g++ to 00146 # be used since this would add -lstdc++ to the link line which of 00147 # course is problematic at this point. So, we get the top-level 00148 # directory to configure libstdc++-v3 to use gcc as the C++ 00149 # compilation driver. 00150 CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \ 00151 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@