1 ## Makefile for the src subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
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)
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.
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,
24 AUTOMAKE_OPTIONS = 1.3 gnits
25 MAINT_CHARSET = latin1
27 # Cross compiler and multilib support.
28 # Install a library built with a cross compiler in tooldir, not libdir.
30 toolexeclibdir = $(libdir)$(MULTISUBDIR)
32 toolexecdir = $(exec_prefix)/$(target_alias)
33 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
36 toolexeclib_LTLIBRARIES = libstdc++.la
37 EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
41 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fsquangle -fnew-exceptions \
42 # -fdata-sections -ffunction-sections \
43 # -fvtable-gc -Wl,--gc-sections
44 # AC_CXXFLAGS = @OPTLEVEL@ @DEBUGFLAGS@ @NAMESPACES@
45 AC_CXXFLAGS = @CPUFLAGS@ @DEBUGFLAGS@
46 AM_CXXFLAGS = -fno-implicit-templates \
47 -Wall -Wno-format -W -Wwrite-strings -Winline $(WERROR) \
48 $(OPTIMIZE_CXXFLAGS) $(AC_CXXFLAGS)
50 # Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
51 # things like -O2 passed down from the toplevel can be overridden by
53 CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) \
54 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
56 LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) \
57 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
59 # We have a problem when building the shared libstdc++ object if the
60 # rules automake generates would be used. We cannot allow CXX to be used
61 # in libtool since this would add -lstdc++ to the link line which of
62 # course is impossible.
63 CXXLINK = $(LIBTOOL) --mode=link "$(CC)" $(AM_CXXFLAGS) $(LDFLAGS) -o $@
65 TOPLEVEL_INCLUDES = -I$(includedir)
66 LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio
69 -I$(top_srcdir)/@cpu_include_dir@ \
70 -I$(top_srcdir)/@ctype_include_dir@
73 -nostdinc++ -I$(top_srcdir) \
74 $(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(TOPLEVEL_INCLUDES)
77 bits/cpp_type_traits.h \
78 bits/std_cctype.h bits/ctype_base.h bits/ctype_specializations.h \
80 bits/basic_string.h bits/std_string.h bits/string.tcc \
81 bits/generic_shadow.h bits/std_utility.h \
83 bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
84 bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
85 bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
86 bits/std_cassert.h bits/std_cwctype.h bits/std_ciso646.h \
87 bits/std_cerrno.h bits/std_cfloat.h bits/std_climits.h \
88 bits/std_clocale.h bits/std_cmath.h \
89 bits/std_csetjmp.h bits/std_csignal.h bits/std_cstdarg.h \
90 bits/std_cstddef.h bits/std_cstdio.h bits/std_cstdlib.h \
91 bits/std_cstring.h bits/std_ctime.h bits/std_cwchar.h \
92 bits/std_typeinfo.h bits/std_new.h \
93 bits/std_exception.h bits/exception_support.h \
94 bits/std_fstream.h bits/std_iomanip.h \
95 bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
96 bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
97 bits/std_istream.h bits/istream.tcc bits/std_locale.h \
98 bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc \
99 bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h \
100 bits/streambuf.tcc bits/basic_file.h \
101 bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
102 bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
103 bits/stl_threads.h bits/stl_iterator_base.h \
104 backward/algo.h backward/algobase.h backward/alloc.h \
105 backward/bvector.h backward/defalloc.h backward/deque.h \
106 backward/function.h backward/hash_map.h backward/hash_set.h \
107 backward/hashtable.h backward/heap.h backward/iterator.h \
108 backward/list.h backward/map.h backward/multimap.h backward/new.h \
109 backward/multiset.h backward/pair.h backward/iostream.h \
110 backward/rope.h backward/set.h backward/slist.h backward/stack.h \
111 backward/tempbuf.h backward/tree.h backward/vector.h \
112 bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
113 bits/std_iterator.h bits/std_list.h \
114 bits/std_map.h bits/std_memory.h bits/std_numeric.h \
115 bits/std_queue.h bits/std_set.h bits/std_stack.h \
116 bits/std_stdexcept.h bits/std_vector.h \
117 bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
118 bits/stl_deque.h bits/stl_function.h \
119 bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
120 bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
121 bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
122 bits/stl_relops.h bits/stl_set.h \
123 bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h \
124 bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
125 bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
126 bits/std_strstream.h \
127 ext/ropeimpl.h ext/stl_rope.h \
128 ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h \
129 ext/stl_hashtable.h ext/stl_hash_fun.h \
130 ext/hash_map ext/hash_set ext/rope ext/slist \
131 ext/tree ext/bvector \
132 shadow/assert.h shadow/ctype.h shadow/errno.h shadow/float.h \
134 shadow/limits.h shadow/locale.h shadow/math.h shadow/setjmp.h \
135 shadow/signal.h shadow/stdarg.h shadow/stddef.h shadow/stdio.h \
136 shadow/stdlib.h shadow/string.h shadow/time.h \
137 shadow/unistd.h shadow/wchar.h shadow/wctype.h \
138 shadow/bits/std_cassert.h shadow/bits/std_cctype.h \
139 shadow/bits/std_cerrno.h shadow/bits/std_cfloat.h \
140 shadow/bits/std_climits.h shadow/bits/std_clocale.h \
141 shadow/bits/std_cmath.h shadow/bits/std_csetjmp.h \
142 shadow/bits/std_csignal.h shadow/bits/std_cstdarg.h \
143 shadow/bits/std_cstddef.h shadow/bits/std_cstdio.h \
144 shadow/bits/std_cstdlib.h shadow/bits/std_cstring.h \
145 shadow/bits/std_ctime.h shadow/bits/std_cwchar.h \
146 shadow/bits/std_cwctype.h \
147 shadow/bits/wrap_libio.h shadow/bits/wrap_unistd.h \
151 algorithm bitset cassert cctype cerrno cfloat climits clocale ciso646 \
152 cmath complex csetjmp csignal cstdarg cstddef cstdio cstdlib \
153 cstring ctime cwchar cwctype deque exception fstream functional \
154 iomanip ios iosfwd iostream istream iterator limits list locale \
155 map memory new numeric ostream queue set sstream stack stdexcept \
156 streambuf string strstream typeinfo utility valarray vector
158 if GLIBCPP_NEED_LIBIO
160 $(top_builddir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
165 generated_headers = \
166 bits/std_limits.h bits/c++config.h bits/c++threads.h bits/c++io.h
169 $(top_srcdir)/@cpu_include_dir@/bits/atomicity.h
172 stringMAIN.cc stringCTORNC.cc stringCTORAL.cc \
173 stringCTORCPR.cc stringCTORCPRAL.cc stringCTORPRAL.cc \
174 stringCTORPAL.cc stringCTORDUPAL.cc stringCTORPP.cc stringCTORII.cc \
175 stringMUTATE.cc stringRESERVE.cc \
176 stringSWAP.cc stringSLOP.cc \
177 stringRESIZE.cc stringAPPCOPY.cc stringAPPCPR.cc stringAPPPR.cc \
178 stringAPPDUP.cc stringAPPII.cc stringASSCP.cc stringASSII.cc \
179 stringINSII.cc stringREPRR.cc stringREPIIDUP.cc stringREPII.cc \
180 stringREPIII.cc stringREP4I.cc stringREPIIPP.cc stringREPIIPP2.cc \
181 stringCOPY.cc stringCONII.cc stringCONIIF.cc stringCONPPF.cc \
182 stringCONPPF2.cc stringCONSC.cc \
183 stringFIND.cc stringFINDC.cc stringRFIND.cc \
184 stringRFINDC.cc stringFFO.cc stringFLO.cc stringFFNO.cc \
185 stringFLNO.cc stringFLNOC.cc stringCOMPARE.cc stringCOMPARE2.cc \
186 stringCOMPAREP.cc stringCOMPAREP2.cc stringADDPS.cc stringADDCS.cc \
187 stringEXTRACT.cc stringINSERT.cc stringGETLINE.cc stringSCOPY.cc \
191 wstringMAIN.cc wstringCTORNC.cc wstringCTORAL.cc \
192 wstringCTORCPR.cc wstringCTORCPRAL.cc wstringCTORPRAL.cc \
193 wstringCTORPAL.cc wstringCTORDUPAL.cc wstringCTORPP.cc \
195 wstringMUTATE.cc wstringRESERVE.cc \
196 wstringSWAP.cc wstringSLOP.cc \
197 wstringRESIZE.cc wstringAPPCOPY.cc wstringAPPCPR.cc wstringAPPPR.cc \
198 wstringAPPDUP.cc wstringAPPII.cc wstringASSCP.cc wstringASSII.cc \
199 wstringINSII.cc wstringREPRR.cc wstringREPIIDUP.cc wstringREPII.cc \
200 wstringREPIII.cc wstringREP4I.cc wstringREPIIPP.cc wstringREPIIPP2.cc \
201 wstringCOPY.cc wstringCONII.cc wstringCONIIF.cc wstringCONPPF.cc \
202 wstringCONPPF2.cc wstringCONSC.cc \
203 wstringFIND.cc wstringFINDC.cc wstringRFIND.cc \
204 wstringRFINDC.cc wstringFFO.cc wstringFLO.cc wstringFFNO.cc \
205 wstringFLNO.cc wstringFLNOC.cc wstringCOMPARE.cc wstringCOMPARE2.cc \
206 wstringCOMPAREP.cc wstringCOMPAREP2.cc wstringADDPS.cc \
207 wstringADDCS.cc wstringEXTRACT.cc wstringINSERT.cc wstringGETLINE.cc \
208 wstringSCOPY.cc wstringEQ.cc
211 limitsMEMBERS.cc c++io.cc \
213 complex.cc complexf.cc complexl.cc complex_io.cc \
214 stdexcept.cc ios.cc stdstreams.cc strstream.cc \
215 locale.cc localename.cc \
216 locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc
218 VPATH += $(top_srcdir) $(top_srcdir)/std $(top_srcdir)/src
219 VPATH += $(top_srcdir)/@ctype_include_dir@
222 # Actual sources for the distro, but don't build these.
223 EXTRA_sources = string-inst.cc
225 libstdc___la_SOURCES = $(sources)
227 libinst_string_la_SOURCES = $(string_sources)
229 libinst_wstring_la_SOURCES = $(wstring_sources)
231 libstdc___la_LIBADD = \
232 ../math/libmath.la ../libio/libio.la \
233 libinst-string.la @libinst_wstring_la@
235 libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
237 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
240 # We cannot use the default rules to install headers since we cannot
241 # statically decide which headers to install. So we have our own special
242 # installation routine here.
243 myincludep = $(DESTDIR)$(includedir)/g++-v3/
245 install: myinstallheaders
247 # NB: As libio_headers may be empty, need this to make sure bash doesn't
248 # choke on an empty for... loop by using libio_headers_install
250 myinstallheaders: $(headers:%=$(myincludep)%)
251 if test -z "$(MULTISUBDIR)"; then \
252 for i in $(std_headers); do \
253 echo "$(INSTALL_DATA) $(top_srcdir)/std/$$i $(myincludep)"; \
254 $(INSTALL_DATA) $(top_srcdir)/std/$$i $(myincludep); \
256 for i in $(generated_headers); do \
257 echo "$(INSTALL_DATA) $(top_builddir)/$$i $(myincludep)bits/"; \
258 $(INSTALL_DATA) $(top_builddir)/$$i $(myincludep)bits/; \
260 libio_headers_install='$(libio_headers)'; \
261 for i in $$libio_headers_install; do \
262 echo "$(INSTALL_DATA) $$i $(myincludep)"; \
263 $(INSTALL_DATA) $$i $(myincludep); \
265 echo "$(INSTALL_DATA) $(cpu_headers) $(myincludep)bits/"; \
266 $(INSTALL_DATA) $(cpu_headers) $(myincludep)bits/; \
269 $(headers:%=$(myincludep)%): $(myincludep)%: %
270 if test -z "$(MULTISUBDIR)"; then \
271 $(mkinstalldirs) $(@D); \
272 echo " $(INSTALL_DATA) $^ $@"; \
273 $(INSTALL_DATA) $^ $@; \
276 # For the next time we have to handle misc-inst.cc and locale-inst.cc
277 # in a special way since we cannot instantiate all classes due to
278 # missing definitions for things like vptrs, type_info bits, etc. when
279 # using -fno-implicit-templates.
280 misc-inst.o: misc-inst.cc
281 $(CXXCOMPILE) -fimplicit-templates -c $<
282 misc-inst.lo: misc-inst.cc
283 $(LTCXXCOMPILE) -fimplicit-templates -c $<
284 locale-inst.o: locale-inst.cc
285 $(CXXCOMPILE) -fimplicit-templates -c $<
286 locale-inst.lo: locale-inst.cc
287 $(LTCXXCOMPILE) -fimplicit-templates -c $<
344 stringEQ.lo : string-inst.cc
345 $(LTCXXCOMPILE) -fimplicit-templates \
346 -c -D`echo $@ | tr -dc 'A-Z'` $< -o $@
352 wstringCTORCPRAL.lo \
355 wstringCTORDUPAL.lo \
396 wstringCOMPAREP2.lo \
403 wstringEQ.lo : string-inst.cc
404 $(LTCXXCOMPILE) -fimplicit-templates \
405 -c -D`echo $@ | tr -dc 'A-Z'` -DC=wchar_t $< -o $@
462 stringEQ.o : string-inst.cc
463 $(CXXCOMPILE) -fimplicit-templates \
464 -c -D`echo $@ | tr -dc 'A-Z'` $< -o $@
521 wstringEQ.o : string-inst.cc
522 $(CXXCOMPILE) -fimplicit-templates \
523 -c -D`echo $@ | tr -dc 'A-Z'` -DC=wchar_t $< -o $@