]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/libsupc++/Makefile.am
Move from CPP to CXX.
[thirdparty/gcc.git] / libstdc++-v3 / libsupc++ / Makefile.am
CommitLineData
06bd10fb
BK
1## Makefile for the GNU C++ Support library.
2##
4ffbd077 3## Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
06bd10fb
BK
4##
5## Process this file with automake to produce Makefile.in.
6##
cbecceb9 7## This file is part of GCC.
06bd10fb 8##
cbecceb9 9## GCC is free software; you can redistribute it and/or modify
06bd10fb
BK
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)
12## any later version.
13##
cbecceb9 14## GCC is distributed in the hope that it will be useful,
06bd10fb
BK
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.
18##
19## You should have received a copy of the GNU General Public License
cbecceb9 20## along with GCC; see the file COPYING. If not, write to
06bd10fb
BK
21## the Free Software Foundation, 59 Temple Place - Suite 330,
22## Boston, MA 02111-1307, USA.
23
24AUTOMAKE_OPTIONS = 1.3 cygnus
25MAINT_CHARSET = latin1
26
ae9dc931
BK
27mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
28
06bd10fb 29# Cross compiler and multilib support.
76f6aa8b 30CC = @CC@
3d7c150e
BK
31CXX = @glibcxx_CXX@
32toolexecdir = @glibcxx_toolexecdir@
33toolexeclibdir = @glibcxx_toolexeclibdir@
06bd10fb
BK
34
35
36# Need this library to both be part of libstdc++.a, and installed
37# separately too.
38# 1) separate libsupc++.la
39toolexeclib_LTLIBRARIES = libsupc++.la
40# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
41noinst_LTLIBRARIES = libsupc++convenience.la
42
0b8e0cf3 43
e466dc8a
BK
44# Compile flags that should be constant throughout the build, both for
45# SUBDIRS and for libstdc++-v3 in general.
46OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
47
48# These bits are all figured out from configure. Look in acinclude.m4
3d7c150e 49# or configure.in to see how they are set. See GLIBCXX_EXPORT_FLAGS
e466dc8a
BK
50# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
51CONFIG_CXXFLAGS = \
697044e0 52 @SECTION_FLAGS@ @EXTRA_CXX_FLAGS@
e466dc8a
BK
53
54# Warning flags to use.
55WARN_CXXFLAGS = \
6a163d7c 56 @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
e466dc8a 57
4ffbd077
BK
58LIBSUPCXX_CXXFLAGS = @LIBSUPCXX_PICFLAGS@
59
3d7c150e
BK
60# Use common includes from acinclude.m4/GLIBCXX_EXPORT_INCLUDES
61GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
e466dc8a 62LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
e01c9849 63GCC_INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include
e466dc8a 64
06bd10fb 65INCLUDES = \
3d7c150e 66 $(GCC_INCLUDES) $(GLIBCXX_INCLUDES) $(LIBSUPCXX_INCLUDES)
06bd10fb
BK
67
68headers = \
e2c09482 69 exception new typeinfo cxxabi.h exception_defines.h
06bd10fb 70
e01c9849 71sources = \
06bd10fb
BK
72 del_op.cc \
73 del_opnt.cc \
74 del_opv.cc \
75 del_opvnt.cc \
52a11cbf
RH
76 eh_alloc.cc \
77 eh_aux_runtime.cc \
78 eh_catch.cc \
79 eh_exception.cc \
80 eh_globals.cc \
81 eh_personality.cc \
fb705416 82 eh_term_handler.cc \
52a11cbf
RH
83 eh_terminate.cc \
84 eh_throw.cc \
74a3070f 85 eh_type.cc \
fb705416 86 eh_unex_handler.cc \
c4f66405 87 guard.cc \
06bd10fb
BK
88 new_handler.cc \
89 new_op.cc \
90 new_opnt.cc \
91 new_opv.cc \
92 new_opvnt.cc \
3734420f 93 pure.cc \
06bd10fb
BK
94 tinfo.cc \
95 tinfo2.cc \
fb705416
PE
96 vec.cc \
97 vterminate.cc
06bd10fb 98
4ffbd077
BK
99libsupc___la_SOURCES = $(sources)
100libsupc__convenience_la_SOURCES = $(sources)
06bd10fb 101
3d7c150e
BK
102glibcxxinstalldir = $(gxx_include_dir)
103glibcxxinstall_HEADERS = $(headers)
a6863e25 104
c7053b70 105# AM_CXXFLAGS needs to be in each subdirectory so that it can be
a9117427
BK
106# modified in a per-library or per-sub-library way. Need to manually
107# set this option because CONFIG_CXXFLAGS has to be after
108# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
4ffbd077 109# as the occasion call for it.
06bd10fb 110AM_CXXFLAGS = \
c7053b70
BK
111 -fno-implicit-templates \
112 $(LIBSUPCXX_CXXFLAGS) \
113 $(WARN_CXXFLAGS) \
114 $(OPTIMIZE_CXXFLAGS) \
115 $(CONFIG_CXXFLAGS)
06bd10fb 116
3bf74da2
MK
117AM_MAKEFLAGS = \
118 "gxx_include_dir=$(gxx_include_dir)"
119
a9117427
BK
120# libstdc++ libtool notes
121
122# 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
123# last. (That way, things like -O2 passed down from the toplevel can
124# be overridden by --enable-debug.)
125
126# 2) In general, libtool expects an argument such as `--tag=CXX' when
127# using the C++ compiler, because that will enable the settings
128# detected when C++ support was being configured. However, when no
129# such flag is given in the command line, libtool attempts to figure
130# it out by matching the compiler name in each configuration section
131# against a prefix of the command line. The problem is that, if the
132# compiler name and its initial flags stored in the libtool
133# configuration file don't match those in the command line, libtool
134# can't decide which configuration to use, and it gives up. The
135# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
136# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
20b11783
MM
137# attempt to infer which configuration to use.
138#
139# We have to put --tag disable-shared after --tag CXX lest things
140# CXX undo the affect of disable-shared.
141LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
142 --mode=compile $(CXX) $(INCLUDES) \
a9117427 143 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
c7053b70 144
787d2fb7
AO
145# 3) We'd have a problem when building the shared libstdc++ object if
146# the rules automake generates would be used. We cannot allow g++ to
147# be used since this would add -lstdc++ to the link line which of
148# course is problematic at this point. So, we get the top-level
149# directory to configure libstdc++-v3 to use gcc as the C++
150# compilation driver.
400f4e55
AO
151CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
152 --mode=link $(CXX) \
153 @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
38fae3e3
HPN
154
155# We have to have rules modified from the default to counteract SUN make
3d7c150e
BK
156# prepending each of $(glibcxxinstall_HEADERS) with VPATH below.
157install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS)
38fae3e3 158 @$(NORMAL_INSTALL)
3d7c150e
BK
159 $(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir)
160 @list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
38fae3e3
HPN
161 q=`echo $$p | sed -e 's,.*/,,'`; \
162 if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
3d7c150e
BK
163 echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \
164 $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \
38fae3e3
HPN
165 done
166
3d7c150e 167uninstall-glibcxxinstallHEADERS:
38fae3e3 168 @$(NORMAL_UNINSTALL)
3d7c150e 169 list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
38fae3e3 170 q=`echo $$p | sed -e 's,.*/,,'`; \
3d7c150e 171 rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \
38fae3e3 172 done