OSDN Git Service

PR libstdc++/14026
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / libsupc++ / Makefile.am
1 ## Makefile for the GNU C++ Support library.
2 ##
3 ## Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4 ##
5 ## Process this file with automake to produce Makefile.in.
6 ##
7 ## This file is part of GCC.
8 ##
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)
12 ## any later version.
13 ##
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.
18 ##
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.
23
24 include $(top_srcdir)/fragment.am
25
26 # Need this library to both be part of libstdc++.a, and installed
27 # separately too.
28 # 1) separate libsupc++.la
29 toolexeclib_LTLIBRARIES = libsupc++.la
30 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
31 noinst_LTLIBRARIES = libsupc++convenience.la
32
33
34 headers = \
35         exception new typeinfo cxxabi.h exception_defines.h
36
37 sources = \
38         del_op.cc \
39         del_opnt.cc \
40         del_opv.cc \
41         del_opvnt.cc \
42         eh_alloc.cc \
43         eh_aux_runtime.cc \
44         eh_catch.cc \
45         eh_exception.cc \
46         eh_globals.cc \
47         eh_personality.cc \
48         eh_term_handler.cc \
49         eh_terminate.cc \
50         eh_throw.cc \
51         eh_type.cc \
52         eh_unex_handler.cc \
53         guard.cc \
54         new_handler.cc \
55         new_op.cc \
56         new_opnt.cc \
57         new_opv.cc \
58         new_opvnt.cc \
59         pure.cc \
60         tinfo.cc \
61         tinfo2.cc \
62         vec.cc \
63         vterminate.cc
64
65 libsupc___la_SOURCES = $(sources)
66 libsupc__convenience_la_SOURCES = $(sources)
67
68 glibcxxinstalldir = $(gxx_include_dir)
69 glibcxxinstall_HEADERS = $(headers)
70
71 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
72 # modified in a per-library or per-sub-library way.  Need to manually
73 # set this option because CONFIG_CXXFLAGS has to be after
74 # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
75 # as the occasion call for it.
76 AM_CXXFLAGS = \
77         -fno-implicit-templates \
78         $(LIBSUPCXX_PICFLAGS) \
79         $(WARN_CXXFLAGS) \
80         $(OPTIMIZE_CXXFLAGS) \
81         $(CONFIG_CXXFLAGS)
82
83 AM_MAKEFLAGS = \
84         "gxx_include_dir=$(gxx_include_dir)"
85
86 # libstdc++ libtool notes
87
88 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
89 # last. (That way, things like -O2 passed down from the toplevel can
90 # be overridden by --enable-debug.)
91
92 # 2) In general, libtool expects an argument such as `--tag=CXX' when
93 # using the C++ compiler, because that will enable the settings
94 # detected when C++ support was being configured.  However, when no
95 # such flag is given in the command line, libtool attempts to figure
96 # it out by matching the compiler name in each configuration section
97 # against a prefix of the command line.  The problem is that, if the
98 # compiler name and its initial flags stored in the libtool
99 # configuration file don't match those in the command line, libtool
100 # can't decide which configuration to use, and it gives up.  The
101 # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
102 # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
103 # attempt to infer which configuration to use.
104 #
105 # We have to put --tag disable-shared after --tag CXX lest things
106 # CXX undo the affect of disable-shared.
107 LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
108                --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \
109                $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
110
111 # 3) We'd have a problem when building the shared libstdc++ object if
112 # the rules automake generates would be used.  We cannot allow g++ to
113 # be used since this would add -lstdc++ to the link line which of
114 # course is problematic at this point.  So, we get the top-level
115 # directory to configure libstdc++-v3 to use gcc as the C++
116 # compilation driver.
117 CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
118           --mode=link $(CXX) \
119           $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
120
121 # We have to have rules modified from the default to counteract SUN make
122 # prepending each of $(glibcxxinstall_HEADERS) with VPATH below.
123 install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS)
124         @$(NORMAL_INSTALL)
125         $(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir)
126         @list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
127           q=`echo $$p | sed -e 's,.*/,,'`; \
128           if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
129           echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \
130           $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \
131         done
132
133 uninstall-glibcxxinstallHEADERS:
134         @$(NORMAL_UNINSTALL)
135         list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
136           q=`echo $$p | sed -e 's,.*/,,'`; \
137           rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \
138         done