]>
Commit | Line | Data |
---|---|---|
06bd10fb BK |
1 | ## Makefile for the GNU C++ Support library. |
2 | ## | |
40fcf31b | 3 | ## Copyright (C) 2000, 2001, 2002, 2003, 2004 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 | 21 | ## the Free Software Foundation, 59 Temple Place - Suite 330, |
ca618b60 | 22 | ## Boston, MA 02111-1307, USA. |
06bd10fb | 23 | |
0df3f383 | 24 | include $(top_srcdir)/fragment.am |
06bd10fb BK |
25 | |
26 | # Need this library to both be part of libstdc++.a, and installed | |
27 | # separately too. | |
ca618b60 | 28 | # 1) separate libsupc++.la |
06bd10fb BK |
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 | ||
0b8e0cf3 | 33 | |
06bd10fb | 34 | headers = \ |
ca618b60 | 35 | exception new typeinfo cxxabi.h exception_defines.h |
06bd10fb | 36 | |
40fcf31b BK |
37 | c_sources = \ |
38 | cp-demangle.c | |
39 | ||
e01c9849 | 40 | sources = \ |
06bd10fb BK |
41 | del_op.cc \ |
42 | del_opnt.cc \ | |
43 | del_opv.cc \ | |
44 | del_opvnt.cc \ | |
52a11cbf RH |
45 | eh_alloc.cc \ |
46 | eh_aux_runtime.cc \ | |
47 | eh_catch.cc \ | |
48 | eh_exception.cc \ | |
49 | eh_globals.cc \ | |
50 | eh_personality.cc \ | |
fb705416 | 51 | eh_term_handler.cc \ |
52a11cbf RH |
52 | eh_terminate.cc \ |
53 | eh_throw.cc \ | |
74a3070f | 54 | eh_type.cc \ |
fb705416 | 55 | eh_unex_handler.cc \ |
c4f66405 | 56 | guard.cc \ |
06bd10fb BK |
57 | new_handler.cc \ |
58 | new_op.cc \ | |
59 | new_opnt.cc \ | |
60 | new_opv.cc \ | |
61 | new_opvnt.cc \ | |
3734420f | 62 | pure.cc \ |
06bd10fb BK |
63 | tinfo.cc \ |
64 | tinfo2.cc \ | |
fb705416 PE |
65 | vec.cc \ |
66 | vterminate.cc | |
06bd10fb | 67 | |
40fcf31b BK |
68 | libsupc___la_SOURCES = $(sources) $(c_sources) |
69 | libsupc__convenience_la_SOURCES = $(sources) $(c_sources) | |
06bd10fb | 70 | |
3d7c150e BK |
71 | glibcxxinstalldir = $(gxx_include_dir) |
72 | glibcxxinstall_HEADERS = $(headers) | |
a6863e25 | 73 | |
c7053b70 | 74 | # AM_CXXFLAGS needs to be in each subdirectory so that it can be |
a9117427 BK |
75 | # modified in a per-library or per-sub-library way. Need to manually |
76 | # set this option because CONFIG_CXXFLAGS has to be after | |
77 | # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden | |
ca618b60 | 78 | # as the occasion call for it. |
06bd10fb | 79 | AM_CXXFLAGS = \ |
c7053b70 | 80 | -fno-implicit-templates \ |
82ba99d5 | 81 | $(LIBSUPCXX_PICFLAGS) \ |
c7053b70 BK |
82 | $(WARN_CXXFLAGS) \ |
83 | $(OPTIMIZE_CXXFLAGS) \ | |
ca618b60 | 84 | $(CONFIG_CXXFLAGS) |
06bd10fb | 85 | |
3bf74da2 MK |
86 | AM_MAKEFLAGS = \ |
87 | "gxx_include_dir=$(gxx_include_dir)" | |
88 | ||
40fcf31b BK |
89 | |
90 | # Use special rules for pulling things out of libiberty. These | |
91 | # objects should be compiled with the "C" compiler, not the C++ | |
92 | # compiler, and also should not use the C++ includes. | |
93 | C_INCLUDES = -I.. -I$(toplevel_srcdir)/libiberty -I$(toplevel_srcdir)/include | |
94 | C_COMPILE = \ | |
95 | $(CC) $(DEFS) $(C_INCLUDES) \ | |
96 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | |
97 | ||
98 | # LTCOMPILE is copied from LTCXXCOMPILE below. | |
99 | LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared --mode=compile $(CC) \ | |
100 | $(DEFS) $(C_INCLUDES) $(LIBSUPCXX_PICFLAGS) \ | |
101 | $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | |
102 | ||
103 | cp-demangle.c: | |
104 | rm -f $@ | |
105 | $(LN_S) $(toplevel_srcdir)/libiberty/cp-demangle.c $@ | |
106 | cp-demangle.lo: cp-demangle.c | |
107 | $(LTCOMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $< | |
108 | cp-demangle.o: cp-demangle.c | |
109 | $(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $< | |
110 | ||
111 | ||
a9117427 BK |
112 | # libstdc++ libtool notes |
113 | ||
114 | # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is | |
115 | # last. (That way, things like -O2 passed down from the toplevel can | |
116 | # be overridden by --enable-debug.) | |
117 | ||
118 | # 2) In general, libtool expects an argument such as `--tag=CXX' when | |
119 | # using the C++ compiler, because that will enable the settings | |
120 | # detected when C++ support was being configured. However, when no | |
121 | # such flag is given in the command line, libtool attempts to figure | |
122 | # it out by matching the compiler name in each configuration section | |
123 | # against a prefix of the command line. The problem is that, if the | |
124 | # compiler name and its initial flags stored in the libtool | |
125 | # configuration file don't match those in the command line, libtool | |
126 | # can't decide which configuration to use, and it gives up. The | |
127 | # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe | |
128 | # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to | |
20b11783 MM |
129 | # attempt to infer which configuration to use. |
130 | # | |
131 | # We have to put --tag disable-shared after --tag CXX lest things | |
132 | # CXX undo the affect of disable-shared. | |
133 | LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \ | |
ca618b60 PE |
134 | --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ |
135 | $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) | |
c7053b70 | 136 | |
787d2fb7 AO |
137 | # 3) We'd have a problem when building the shared libstdc++ object if |
138 | # the rules automake generates would be used. We cannot allow g++ to | |
139 | # be used since this would add -lstdc++ to the link line which of | |
140 | # course is problematic at this point. So, we get the top-level | |
141 | # directory to configure libstdc++-v3 to use gcc as the C++ | |
142 | # compilation driver. | |
400f4e55 | 143 | CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \ |
ca618b60 PE |
144 | --mode=link $(CXX) \ |
145 | $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@ | |
38fae3e3 HPN |
146 | |
147 | # We have to have rules modified from the default to counteract SUN make | |
3d7c150e BK |
148 | # prepending each of $(glibcxxinstall_HEADERS) with VPATH below. |
149 | install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS) | |
38fae3e3 | 150 | @$(NORMAL_INSTALL) |
3d7c150e BK |
151 | $(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir) |
152 | @list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \ | |
38fae3e3 HPN |
153 | q=`echo $$p | sed -e 's,.*/,,'`; \ |
154 | if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ | |
3d7c150e BK |
155 | echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \ |
156 | $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \ | |
38fae3e3 HPN |
157 | done |
158 | ||
3d7c150e | 159 | uninstall-glibcxxinstallHEADERS: |
38fae3e3 | 160 | @$(NORMAL_UNINSTALL) |
3d7c150e | 161 | list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \ |
38fae3e3 | 162 | q=`echo $$p | sed -e 's,.*/,,'`; \ |
3d7c150e | 163 | rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \ |
38fae3e3 | 164 | done |