]>
Commit | Line | Data |
---|---|---|
b2dad0e3 BK |
1 | ## Makefile for the src subdirectory of the GNU C++ Standard library. |
2 | ## | |
469550eb | 3 | ## Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
b2dad0e3 BK |
4 | ## |
5 | ## This file is part of the libstdc++ version 3 distribution. | |
6 | ## Process this file with automake to produce Makefile.in. | |
7 | ||
8 | ## This file is part of the GNU ISO C++ Library. This library is free | |
9 | ## software; you can redistribute it and/or modify it under the | |
10 | ## terms of the GNU General Public License as published by the | |
11 | ## Free Software Foundation; either version 2, or (at your option) | |
12 | ## any later version. | |
13 | ||
14 | ## This library 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 along | |
20 | ## with this library; see the file COPYING. If not, write to the Free | |
21 | ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
22 | ## USA. | |
23 | ||
33590f13 | 24 | ## $Id: Makefile.am,v 1.90 2001/07/13 16:47:55 pme Exp $ |
421173e6 | 25 | |
b2dad0e3 BK |
26 | AUTOMAKE_OPTIONS = 1.3 gnits |
27 | MAINT_CHARSET = latin1 | |
28 | ||
ae9dc931 BK |
29 | mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs |
30 | ||
b2dad0e3 | 31 | # Cross compiler and multilib support. |
46840bcd | 32 | CXX = @glibcpp_CXX@ |
72ed2836 BK |
33 | toolexecdir = @glibcpp_toolexecdir@ |
34 | toolexeclibdir = @glibcpp_toolexeclibdir@ | |
b2dad0e3 BK |
35 | toolexeclib_LTLIBRARIES = libstdc++.la |
36 | ||
e466dc8a BK |
37 | # Compile flags that should be constant throughout the build, both for |
38 | # SUBDIRS and for libstdc++-v3 in general. | |
39 | OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ | |
40 | ||
41 | # These bits are all figured out from configure. Look in acinclude.m4 | |
42 | # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS | |
43 | # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. | |
44 | CONFIG_CXXFLAGS = \ | |
45 | @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ | |
46 | ||
47 | # Warning flags to use. | |
48 | WARN_CXXFLAGS = \ | |
6a163d7c | 49 | @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once |
e466dc8a BK |
50 | |
51 | # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES | |
4a9d5109 | 52 | GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@ |
e466dc8a BK |
53 | LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ |
54 | LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ | |
55 | LIBIO_INCLUDES = @LIBIO_INCLUDES@ | |
a40ba78e | 56 | TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ |
e466dc8a | 57 | |
5b80666b | 58 | INCLUDES = \ |
85fe3810 | 59 | -nostdinc++ \ |
4a9d5109 | 60 | $(GLIBCPP_INCLUDES) \ |
a40ba78e | 61 | $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \ |
c21b6f87 | 62 | $(TOPLEVEL_INCLUDES) |
5b80666b | 63 | |
5b80666b | 64 | sources = \ |
e4bf6077 PE |
65 | basic_file.cc bitset.cc c++locale.cc cmath.cc codecvt.cc \ |
66 | complex_io.cc functexcept.cc globals.cc ios.cc limitsMEMBERS.cc \ | |
33590f13 BK |
67 | locale.cc locale-inst.cc localename.cc messages_members.cc \ |
68 | misc-inst.cc stdexcept.cc stl-inst.cc string-inst.cc strstream.cc \ | |
69 | valarray-inst.cc wstring-inst.cc | |
b2dad0e3 | 70 | |
4a9d5109 | 71 | VPATH = $(top_srcdir):$(top_srcdir)/src |
b2dad0e3 | 72 | |
b2dad0e3 BK |
73 | libstdc___la_SOURCES = $(sources) |
74 | ||
5d89258a | 75 | libstdc___la_LIBADD = \ |
c4d3f801 | 76 | ../libmath/libmath.la @libio_la@ \ |
4cacbdf2 | 77 | ../libsupc++/libsupc++convenience.la |
b2dad0e3 BK |
78 | |
79 | libstdc___la_LDFLAGS = -version-info 3:0:0 -lm | |
80 | ||
5d89258a BK |
81 | libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD) |
82 | ||
b2dad0e3 | 83 | |
e08838ac BK |
84 | # Use special rules for the deprecated source files so that they find |
85 | # deprecated include files. | |
4a9d5109 | 86 | GLIBCPP_INCLUDE_DIR=@glibcpp_builddir@/include |
e08838ac BK |
87 | strstream.lo: strstream.cc |
88 | $(LTCXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $< | |
89 | strstream.o: strstream.cc | |
90 | $(CXXCOMPILE) -I$(GLIBCPP_INCLUDE_DIR)/backward -c $< | |
91 | ||
a40ba78e | 92 | |
0b8e0cf3 | 93 | # AM_CXXFLAGS needs to be in each subdirectory so that it can be |
a9117427 BK |
94 | # modified in a per-library or per-sub-library way. Need to manually |
95 | # set this option because CONFIG_CXXFLAGS has to be after | |
96 | # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden | |
97 | # as the occasion call for it. (ie, --enable-debug) | |
30a20a1e PE |
98 | # |
99 | # The no-implicit-templates flag will generate unresolved references to | |
100 | # the concept-checking symbols. So we must disable the checks while | |
101 | # actually building the library. | |
0b8e0cf3 | 102 | AM_CXXFLAGS = \ |
47e982b2 | 103 | -fno-implicit-templates \ |
a9117427 | 104 | $(LIBSUPCXX_CXXFLAGS) \ |
0b8e0cf3 BK |
105 | $(WARN_CXXFLAGS) \ |
106 | $(OPTIMIZE_CXXFLAGS) \ | |
107 | $(CONFIG_CXXFLAGS) | |
108 | ||
e974e9cc | 109 | |
a9117427 BK |
110 | # libstdc++ libtool notes |
111 | ||
112 | # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is | |
113 | # last. (That way, things like -O2 passed down from the toplevel can | |
114 | # be overridden by --enable-debug.) | |
115 | ||
116 | # 2) In general, libtool expects an argument such as `--tag=CXX' when | |
117 | # using the C++ compiler, because that will enable the settings | |
118 | # detected when C++ support was being configured. However, when no | |
119 | # such flag is given in the command line, libtool attempts to figure | |
120 | # it out by matching the compiler name in each configuration section | |
121 | # against a prefix of the command line. The problem is that, if the | |
122 | # compiler name and its initial flags stored in the libtool | |
123 | # configuration file don't match those in the command line, libtool | |
124 | # can't decide which configuration to use, and it gives up. The | |
125 | # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe | |
126 | # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to | |
127 | # attempt to infer which configuration to use | |
128 | LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \ | |
129 | $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) | |
e974e9cc | 130 | |
787d2fb7 AO |
131 | # 3) We'd have a problem when building the shared libstdc++ object if |
132 | # the rules automake generates would be used. We cannot allow g++ to | |
133 | # be used since this would add -lstdc++ to the link line which of | |
134 | # course is problematic at this point. So, we get the top-level | |
135 | # directory to configure libstdc++-v3 to use gcc as the C++ | |
136 | # compilation driver. | |
137 | CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \ | |
a9117427 | 138 | @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ |