1 ## Makefile for the GNU C++ Support library.
3 ## Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5 ## Process this file with automake to produce Makefile.in.
7 ## This file is part of GCC.
9 ## GCC is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2, or (at your option)
14 ## GCC 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
20 ## along with GCC; see the file COPYING. If not, write to
21 ## the Free Software Foundation, 59 Temple Place - Suite 330,
22 ## Boston, MA 02111-1307, USA.
24 MAINT_CHARSET = latin1
26 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
28 # Cross compiler and multilib support.
30 toolexecdir = @glibcxx_toolexecdir@
31 toolexeclibdir = @glibcxx_toolexeclibdir@
34 # Need this library to both be part of libstdc++.a, and installed
36 # 1) separate libsupc++.la
37 toolexeclib_LTLIBRARIES = libsupc++.la
38 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
39 noinst_LTLIBRARIES = libsupc++convenience.la
42 # Compile flags that should be constant throughout the build, both for
43 # SUBDIRS and for libstdc++-v3 in general.
44 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
46 # These bits are all figured out from configure. Look in acinclude.m4
47 # or configure.in to see how they are set. See GLIBCXX_EXPORT_FLAGS
48 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
50 @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
52 # Warning flags to use.
54 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
56 LIBSUPCXX_CXXFLAGS = @LIBSUPCXX_PICFLAGS@
58 # Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
59 GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
60 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
61 GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include
64 $(GCC_INCLUDES) $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES)
67 exception new typeinfo cxxabi.h exception_defines.h
97 libsupc___la_SOURCES = $(sources)
98 libsupc__convenience_la_SOURCES = $(sources)
100 glibcxxinstalldir = $(gxx_include_dir)
101 glibcxxinstall_HEADERS = $(headers)
103 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
104 # modified in a per-library or per-sub-library way. Need to manually
105 # set this option because CONFIG_CXXFLAGS has to be after
106 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
107 # as the occasion call for it.
109 -fno-implicit-templates \
110 $(LIBSUPCXX_CXXFLAGS) \
112 $(OPTIMIZE_CXXFLAGS) \
116 "gxx_include_dir=$(gxx_include_dir)"
118 # libstdc++ libtool notes
120 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
121 # last. (That way, things like -O2 passed down from the toplevel can
122 # be overridden by --enable-debug.)
124 # 2) In general, libtool expects an argument such as `--tag=CXX' when
125 # using the C++ compiler, because that will enable the settings
126 # detected when C++ support was being configured. However, when no
127 # such flag is given in the command line, libtool attempts to figure
128 # it out by matching the compiler name in each configuration section
129 # against a prefix of the command line. The problem is that, if the
130 # compiler name and its initial flags stored in the libtool
131 # configuration file don't match those in the command line, libtool
132 # can't decide which configuration to use, and it gives up. The
133 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
134 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
135 # attempt to infer which configuration to use.
137 # We have to put --tag disable-shared after --tag CXX lest things
138 # CXX undo the affect of disable-shared.
139 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
140 --mode=compile $(CXX) $(INCLUDES) \
141 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
143 # 3) We'd have a problem when building the shared libstdc++ object if
144 # the rules automake generates would be used. We cannot allow g++ to
145 # be used since this would add -lstdc++ to the link line which of
146 # course is problematic at this point. So, we get the top-level
147 # directory to configure libstdc++-v3 to use gcc as the C++
148 # compilation driver.
149 CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
151 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
153 # We have to have rules modified from the default to counteract SUN make
154 # prepending each of $(glibcxxinstall_HEADERS) with VPATH below.
155 install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS)
157 $(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir)
158 @list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
159 q=`echo $$p | sed -e 's,.*/,,'`; \
160 if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
161 echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \
162 $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \
165 uninstall-glibcxxinstallHEADERS:
167 list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
168 q=`echo $$p | sed -e 's,.*/,,'`; \
169 rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \