xref: /dflybsd-src/contrib/gcc-4.7/libstdc++-v3/libsupc++/Makefile.am (revision 81fc95a5293ee307c688a350a3feb4734aaddbb4)
1e4b17023SJohn Marino## Makefile for the GNU C++ Support library.
2e4b17023SJohn Marino##
3e4b17023SJohn Marino## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4e4b17023SJohn Marino## 2009, 2010, 2011, 2012
5e4b17023SJohn Marino## Free Software Foundation, Inc.
6e4b17023SJohn Marino##
7e4b17023SJohn Marino## Process this file with automake to produce Makefile.in.
8e4b17023SJohn Marino##
9e4b17023SJohn Marino## This file is part of GCC.
10e4b17023SJohn Marino##
11e4b17023SJohn Marino## GCC is free software; you can redistribute it and/or modify
12e4b17023SJohn Marino## it under the terms of the GNU General Public License as published by
13e4b17023SJohn Marino## the Free Software Foundation; either version 3, or (at your option)
14e4b17023SJohn Marino## any later version.
15e4b17023SJohn Marino##
16e4b17023SJohn Marino## GCC is distributed in the hope that it will be useful,
17e4b17023SJohn Marino## but WITHOUT ANY WARRANTY; without even the implied warranty of
18e4b17023SJohn Marino## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19e4b17023SJohn Marino## GNU General Public License for more details.
20e4b17023SJohn Marino##
21e4b17023SJohn Marino## You should have received a copy of the GNU General Public License
22e4b17023SJohn Marino## along with GCC; see the file COPYING3.  If not see
23e4b17023SJohn Marino## <http://www.gnu.org/licenses/>.
24e4b17023SJohn Marino
25e4b17023SJohn Marinoinclude $(top_srcdir)/fragment.am
26e4b17023SJohn Marino
27e4b17023SJohn Marino# Need this library to both be part of libstdc++.a, and installed
28e4b17023SJohn Marino# separately too.
29e4b17023SJohn Marino# 1) separate libsupc++.la
30e4b17023SJohn Marinotoolexeclib_LTLIBRARIES = libsupc++.la
31e4b17023SJohn Marino# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
32e4b17023SJohn Marinonoinst_LTLIBRARIES = libsupc++convenience.la
33e4b17023SJohn Marino
34e4b17023SJohn Marinostd_HEADERS = \
35e4b17023SJohn Marino	cxxabi.h exception initializer_list new typeinfo
36e4b17023SJohn Marino
37e4b17023SJohn Marinobits_HEADERS = \
38e4b17023SJohn Marino	atomic_lockfree_defines.h cxxabi_forced.h \
39e4b17023SJohn Marino	exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h
40e4b17023SJohn Marino
41e4b17023SJohn Marinoheaders = $(std_HEADERS) $(bits_HEADERS)
42e4b17023SJohn Marino
43e4b17023SJohn Marinoif GLIBCXX_HOSTED
44e4b17023SJohn Marino  c_sources = \
45e4b17023SJohn Marino	cp-demangle.c
46e4b17023SJohn Marinoendif
47e4b17023SJohn Marino
48e4b17023SJohn Marinosources = \
49e4b17023SJohn Marino	array_type_info.cc \
50e4b17023SJohn Marino	atexit_arm.cc \
51e4b17023SJohn Marino	bad_alloc.cc \
52e4b17023SJohn Marino	bad_cast.cc \
53e4b17023SJohn Marino	bad_typeid.cc \
54e4b17023SJohn Marino	class_type_info.cc \
55e4b17023SJohn Marino	del_op.cc \
56e4b17023SJohn Marino	del_opnt.cc \
57e4b17023SJohn Marino	del_opv.cc \
58e4b17023SJohn Marino	del_opvnt.cc \
59e4b17023SJohn Marino	dyncast.cc \
60e4b17023SJohn Marino	eh_alloc.cc \
61e4b17023SJohn Marino	eh_arm.cc \
62e4b17023SJohn Marino	eh_aux_runtime.cc \
63e4b17023SJohn Marino	eh_call.cc \
64e4b17023SJohn Marino	eh_catch.cc \
65e4b17023SJohn Marino	eh_exception.cc \
66e4b17023SJohn Marino	eh_globals.cc \
67e4b17023SJohn Marino	eh_personality.cc \
68e4b17023SJohn Marino	eh_ptr.cc \
69e4b17023SJohn Marino	eh_term_handler.cc \
70e4b17023SJohn Marino	eh_terminate.cc \
71e4b17023SJohn Marino	eh_tm.cc \
72e4b17023SJohn Marino	eh_throw.cc \
73e4b17023SJohn Marino	eh_type.cc \
74e4b17023SJohn Marino	eh_unex_handler.cc \
75e4b17023SJohn Marino	enum_type_info.cc \
76e4b17023SJohn Marino	function_type_info.cc \
77e4b17023SJohn Marino	fundamental_type_info.cc \
78e4b17023SJohn Marino	guard.cc \
79e4b17023SJohn Marino	guard_error.cc \
80e4b17023SJohn Marino	hash_bytes.cc \
81e4b17023SJohn Marino	nested_exception.cc \
82e4b17023SJohn Marino	new_handler.cc \
83e4b17023SJohn Marino	new_op.cc \
84e4b17023SJohn Marino	new_opnt.cc \
85e4b17023SJohn Marino	new_opv.cc \
86e4b17023SJohn Marino	new_opvnt.cc \
87e4b17023SJohn Marino	pbase_type_info.cc \
88e4b17023SJohn Marino	pmem_type_info.cc \
89e4b17023SJohn Marino	pointer_type_info.cc \
90e4b17023SJohn Marino	pure.cc \
91e4b17023SJohn Marino	si_class_type_info.cc \
92e4b17023SJohn Marino	tinfo.cc \
93e4b17023SJohn Marino	tinfo2.cc \
94e4b17023SJohn Marino	vec.cc \
95e4b17023SJohn Marino	vmi_class_type_info.cc \
96e4b17023SJohn Marino	vterminate.cc
97e4b17023SJohn Marino
98e4b17023SJohn Marinolibsupc___la_SOURCES = $(sources) $(c_sources)
99e4b17023SJohn Marinolibsupc__convenience_la_SOURCES = $(sources) $(c_sources)
100e4b17023SJohn Marino
101e4b17023SJohn Marinocp-demangle.c:
102e4b17023SJohn Marino	rm -f $@
103e4b17023SJohn Marino	$(LN_S) $(toplevel_srcdir)/libiberty/cp-demangle.c $@
104e4b17023SJohn Marinocp-demangle.lo: cp-demangle.c
105e4b17023SJohn Marino	$(LTCOMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
106e4b17023SJohn Marinocp-demangle.o: cp-demangle.c
107e4b17023SJohn Marino	$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
108e4b17023SJohn Marino
109e4b17023SJohn Marino
110e4b17023SJohn Marino# Use special rules for the C++0x sources so that the proper flags are passed.
111e4b17023SJohn Marinoeh_ptr.lo: eh_ptr.cc
112e4b17023SJohn Marino	$(LTCXXCOMPILE) -std=gnu++0x -c $<
113e4b17023SJohn Marinoeh_ptr.o: eh_ptr.cc
114e4b17023SJohn Marino	$(CXXCOMPILE) -std=gnu++0x -c $<
115e4b17023SJohn Marino
116e4b17023SJohn Marinoeh_throw.lo: eh_throw.cc
117e4b17023SJohn Marino	$(LTCXXCOMPILE) -std=gnu++0x -c $<
118e4b17023SJohn Marinoeh_throw.o: eh_throw.cc
119e4b17023SJohn Marino	$(CXXCOMPILE) -std=gnu++0x -c $<
120e4b17023SJohn Marino
121e4b17023SJohn Marinoguard.lo: guard.cc
122e4b17023SJohn Marino	$(LTCXXCOMPILE) -std=gnu++0x -c $<
123e4b17023SJohn Marinoguard.o: guard.cc
124e4b17023SJohn Marino	$(CXXCOMPILE) -std=gnu++0x -c $<
125e4b17023SJohn Marino
126e4b17023SJohn Marinonested_exception.lo: nested_exception.cc
127e4b17023SJohn Marino	$(LTCXXCOMPILE) -std=gnu++0x -c $<
128e4b17023SJohn Marinonested_exception.o: nested_exception.cc
129e4b17023SJohn Marino	$(CXXCOMPILE) -std=gnu++0x -c $<
130e4b17023SJohn Marino
131*5ce9237cSJohn Marino# AM_CXXFLAGS needs to be in each subdirectory so that it can be
132*5ce9237cSJohn Marino# modified in a per-library or per-sub-library way.  Need to manually
133*5ce9237cSJohn Marino# set this option because CONFIG_CXXFLAGS has to be after
134*5ce9237cSJohn Marino# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
135*5ce9237cSJohn Marino# as the occasion call for it.
136*5ce9237cSJohn MarinoAM_CXXFLAGS = \
137*5ce9237cSJohn Marino	$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
138*5ce9237cSJohn Marino	$(XTEMPLATE_FLAGS) \
139*5ce9237cSJohn Marino	$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS)  $(CONFIG_CXXFLAGS)
140*5ce9237cSJohn Marino
141*5ce9237cSJohn MarinoAM_MAKEFLAGS = \
142*5ce9237cSJohn Marino	"gxx_include_dir=$(gxx_include_dir)"
143*5ce9237cSJohn Marino
144*5ce9237cSJohn Marino
145*5ce9237cSJohn Marino# Use special rules for pulling things out of libiberty.  These
146*5ce9237cSJohn Marino# objects should be compiled with the "C" compiler, not the C++
147*5ce9237cSJohn Marino# compiler, and also should not use the C++ includes.
148*5ce9237cSJohn MarinoC_INCLUDES = -I.. -I$(toplevel_srcdir)/libiberty -I$(toplevel_srcdir)/include
149*5ce9237cSJohn MarinoC_COMPILE = \
150*5ce9237cSJohn Marino	$(CC) $(DEFS) $(C_INCLUDES) \
151*5ce9237cSJohn Marino	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
152*5ce9237cSJohn Marino
153*5ce9237cSJohn Marino# LTCOMPILE is copied from LTCXXCOMPILE below.
154*5ce9237cSJohn MarinoLTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=compile \
155*5ce9237cSJohn Marino	    $(CC) $(DEFS) $(C_INCLUDES) \
156*5ce9237cSJohn Marino	    $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
157*5ce9237cSJohn Marino	    $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
158*5ce9237cSJohn Marino
159e4b17023SJohn Marino# Libtool notes
160e4b17023SJohn Marino
161*5ce9237cSJohn Marino# 1) In general, libtool expects an argument such as `--tag=CXX' when
162e4b17023SJohn Marino# using the C++ compiler, because that will enable the settings
163e4b17023SJohn Marino# detected when C++ support was being configured.  However, when no
164e4b17023SJohn Marino# such flag is given in the command line, libtool attempts to figure
165e4b17023SJohn Marino# it out by matching the compiler name in each configuration section
166e4b17023SJohn Marino# against a prefix of the command line.  The problem is that, if the
167e4b17023SJohn Marino# compiler name and its initial flags stored in the libtool
168e4b17023SJohn Marino# configuration file don't match those in the command line, libtool
169e4b17023SJohn Marino# can't decide which configuration to use, and it gives up.  The
170e4b17023SJohn Marino# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
171e4b17023SJohn Marino# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
172e4b17023SJohn Marino# attempt to infer which configuration to use.
173e4b17023SJohn Marino#
174*5ce9237cSJohn Marino# The second tag argument, `--tag disable-shared` means that libtool
175*5ce9237cSJohn Marino# only compiles each source once, for static objects. In actuality,
176*5ce9237cSJohn Marino# glibcxx_lt_pic_flag and glibcxx_compiler_shared_flag are added to
177*5ce9237cSJohn Marino# the libtool command that is used create the object, which is
178*5ce9237cSJohn Marino# suitable for shared libraries.  The `--tag disable-shared` must be
179*5ce9237cSJohn Marino# placed after --tag CXX lest things CXX undo the affect of
180*5ce9237cSJohn Marino# disable-shared.
181*5ce9237cSJohn Marino
182*5ce9237cSJohn Marino# 2) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
183*5ce9237cSJohn Marino# last. (That way, things like -O2 passed down from the toplevel can
184*5ce9237cSJohn Marino# be overridden by --enable-debug.)
185e4b17023SJohn MarinoLTCXXCOMPILE = \
186e4b17023SJohn Marino	$(LIBTOOL) --tag CXX --tag disable-shared \
187e4b17023SJohn Marino	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
188e4b17023SJohn Marino	--mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
189e4b17023SJohn Marino	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
190e4b17023SJohn Marino
191e4b17023SJohn MarinoLTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
192e4b17023SJohn Marino
193e4b17023SJohn Marino# 3) We'd have a problem when building the shared libstdc++ object if
194e4b17023SJohn Marino# the rules automake generates would be used.  We cannot allow g++ to
195e4b17023SJohn Marino# be used since this would add -lstdc++ to the link line which of
196e4b17023SJohn Marino# course is problematic at this point.  So, we get the top-level
197e4b17023SJohn Marino# directory to configure libstdc++-v3 to use gcc as the C++
198e4b17023SJohn Marino# compilation driver.
199e4b17023SJohn MarinoCXXLINK = \
200e4b17023SJohn Marino	$(LIBTOOL) --tag CXX --tag disable-shared \
201e4b17023SJohn Marino	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
202e4b17023SJohn Marino	--mode=link $(CXX) \
203e4b17023SJohn Marino	$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
204e4b17023SJohn Marino
205e4b17023SJohn Marino# Install notes
206e4b17023SJohn Marino# We have to have rules modified from the default to counteract SUN make
207e4b17023SJohn Marino# prepending each of $(*_HEADERS) with VPATH below.
208e4b17023SJohn Marinostddir = $(gxx_include_dir)
209e4b17023SJohn Marinobitsdir = $(gxx_include_dir)/bits
210e4b17023SJohn Marino
211e4b17023SJohn Marinoinstall-stdHEADERS: $(std_HEADERS)
212e4b17023SJohn Marino	@$(NORMAL_INSTALL)
213e4b17023SJohn Marino	$(mkinstalldirs) $(DESTDIR)$(stddir)
214e4b17023SJohn Marino	@list='$(std_HEADERS)'; for p in $$list; do \
215e4b17023SJohn Marino	  q=`echo $$p | sed -e 's,.*/,,'`; \
216e4b17023SJohn Marino	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
217e4b17023SJohn Marino	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q"; \
218e4b17023SJohn Marino	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q; \
219e4b17023SJohn Marino	done
220e4b17023SJohn Marino
221e4b17023SJohn Marinoinstall-bitsHEADERS: $(bits_HEADERS)
222e4b17023SJohn Marino	@$(NORMAL_INSTALL)
223e4b17023SJohn Marino	$(mkinstalldirs) $(DESTDIR)$(bitsdir)
224e4b17023SJohn Marino	@list='$(bits_HEADERS)'; for p in $$list; do \
225e4b17023SJohn Marino	  q=`echo $$p | sed -e 's,.*/,,'`; \
226e4b17023SJohn Marino	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
227e4b17023SJohn Marino	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q"; \
228e4b17023SJohn Marino	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q; \
229e4b17023SJohn Marino	done
230e4b17023SJohn Marino
231e4b17023SJohn Marinouninstall-stdHEADERS:
232e4b17023SJohn Marino	@$(NORMAL_UNINSTALL)
233e4b17023SJohn Marino	list='$(std_HEADERS)'; for p in $$list; do \
234e4b17023SJohn Marino	  q=`echo $$p | sed -e 's,.*/,,'`; \
235e4b17023SJohn Marino	  rm -f $(DESTDIR)$(stddir)/$$q; \
236e4b17023SJohn Marino	done
237e4b17023SJohn Marino
238e4b17023SJohn Marinouninstall-bitsHEADERS:
239e4b17023SJohn Marino	@$(NORMAL_UNINSTALL)
240e4b17023SJohn Marino	list='$(bits_HEADERS)'; for p in $$list; do \
241e4b17023SJohn Marino	  q=`echo $$p | sed -e 's,.*/,,'`; \
242e4b17023SJohn Marino	  rm -f $(DESTDIR)$(bitsdir)/$$q; \
243e4b17023SJohn Marino	done
244