1 ## Makefile for the GNU C++ Support library.
3 ## Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
5 ## Process this file with automake to produce Makefile.in.
7 ## This file is part of GNU CC.
9 ## GNU CC 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 ## GNU CC 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 GNU CC; 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 AUTOMAKE_OPTIONS = 1.3 cygnus
25 MAINT_CHARSET = latin1
27 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
29 # Cross compiler and multilib support.
32 toolexecdir = @glibcpp_toolexecdir@
33 toolexeclibdir = @glibcpp_toolexeclibdir@
36 # Need this library to both be part of libstdc++.a, and installed
38 # 1) separate libsupc++.la
39 toolexeclib_LTLIBRARIES = libsupc++.la
40 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
41 noinst_LTLIBRARIES = libsupc++convenience.la
44 # Compile flags that should be constant throughout the build, both for
45 # SUBDIRS and for libstdc++-v3 in general.
46 OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
48 # These bits are all figured out from configure. Look in acinclude.m4
49 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
50 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
52 @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@
54 # Warning flags to use.
56 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
58 # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
59 GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@
60 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
61 GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include
64 $(GCC_INCLUDES) $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES)
67 exception new typeinfo cxxabi.h exception_defines.h
101 libsupc___la_SOURCES = $(sources) $(c_sources)
102 libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
104 glibcppinstalldir = @gxx_include_dir@
105 glibcppinstall_HEADERS = $(headers)
107 LIBSUPCXX_CXXFLAGS = $(LIBSUPCXX_PICFLAGS)
109 # Use special rules for pulling things out of libiberty. These
110 # objects should be compiled with the "C" compiler, not the C++
111 # compiler, and also should not use the C++ includes.
113 $(CC) $(DEFS) $(GCC_INCLUDES) \
114 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
118 $(LN_S) $(toplevel_srcdir)/libiberty/cp-demangle.c $@
119 cxa_demangle.lo: cxa_demangle.c
120 $(LTCOMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
121 cxa_demangle.o: cxa_demangle.c
122 $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
125 $(LN_S) $(toplevel_srcdir)/libiberty/dyn-string.c $@
126 dyn-string.lo: dyn-string.c
127 $(LTCOMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
128 dyn-string.o: dyn-string.c
129 $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
131 # LTCOMPILE is copied from LTCXXCOMPILE below.
132 LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) \
133 $(DEFS) $(GCC_INCLUDES) $(LIBSUPCXX_PICFLAGS) \
134 $(AM_CPPFLAGS) $(CPPFLAGS)
137 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
138 # modified in a per-library or per-sub-library way. Need to manually
139 # set this option because CONFIG_CXXFLAGS has to be after
140 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
141 # as the occasion call for it. (ie, --enable-debug)
143 -fno-implicit-templates \
144 $(LIBSUPCXX_CXXFLAGS) \
146 $(OPTIMIZE_CXXFLAGS) \
149 # libstdc++ libtool notes
151 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
152 # last. (That way, things like -O2 passed down from the toplevel can
153 # be overridden by --enable-debug.)
155 # 2) In general, libtool expects an argument such as `--tag=CXX' when
156 # using the C++ compiler, because that will enable the settings
157 # detected when C++ support was being configured. However, when no
158 # such flag is given in the command line, libtool attempts to figure
159 # it out by matching the compiler name in each configuration section
160 # against a prefix of the command line. The problem is that, if the
161 # compiler name and its initial flags stored in the libtool
162 # configuration file don't match those in the command line, libtool
163 # can't decide which configuration to use, and it gives up. The
164 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
165 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
166 # attempt to infer which configuration to use.
168 # We have to put --tag disable-shared after --tag CXX lest things
169 # CXX undo the affect of disable-shared.
170 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
171 --mode=compile $(CXX) $(INCLUDES) \
172 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
174 # 3) We'd have a problem when building the shared libstdc++ object if
175 # the rules automake generates would be used. We cannot allow g++ to
176 # be used since this would add -lstdc++ to the link line which of
177 # course is problematic at this point. So, we get the top-level
178 # directory to configure libstdc++-v3 to use gcc as the C++
179 # compilation driver.
180 CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
182 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
184 # We have to have rules modified from the default to counteract SUN make
185 # prepending each of $(glibcppinstall_HEADERS) with VPATH below.
186 install-glibcppinstallHEADERS: $(glibcppinstall_HEADERS)
188 $(mkinstalldirs) $(DESTDIR)$(glibcppinstalldir)
189 @list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
190 q=`echo $$p | sed -e 's,.*/,,'`; \
191 if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
192 echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$q"; \
193 $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcppinstalldir)/$$q; \
196 uninstall-glibcppinstallHEADERS:
198 list='$(glibcppinstall_HEADERS)'; for p in $$list; do \
199 q=`echo $$p | sed -e 's,.*/,,'`; \
200 rm -f $(DESTDIR)$(glibcppinstalldir)/$$q; \