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 ## $Id: Makefile.am,v 1.37 2000/10/09 08:55:06 bkoz Exp $
26 AUTOMAKE_OPTIONS = 1.3 gnits
27 MAINT_CHARSET = latin1
29 # Cross compiler and multilib support.
30 # Install a library built with a cross compiler in tooldir, not libdir.
32 toolexeclibdir = $(libdir)$(MULTISUBDIR)
34 toolexecdir = $(exec_prefix)/$(target_alias)
35 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
39 toolexeclib_LTLIBRARIES = libstdc++.la
40 EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
44 -D_GNU_SOURCE -D_ISOC99_SOURCE -nostdinc++ \
45 $(CSHADOW_INCLUDES) $(LIBSUPCXX_INCLUDES) -I$(GLIBCPP_INCLUDE_DIR) \
46 $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) -I$(top_builddir) \
50 bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
51 bits/basic_string.h bits/std_string.h bits/string.tcc \
52 bits/generic_shadow.h bits/std_utility.h \
54 bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
55 bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
56 bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
57 bits/exception_support.h \
58 bits/std_fstream.h bits/std_iomanip.h \
59 bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
60 bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
61 bits/std_istream.h bits/istream.tcc bits/std_locale.h \
62 bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc \
63 bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h \
64 bits/streambuf.tcc bits/basic_file.h \
65 bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
66 bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
67 bits/stl_threads.h bits/stl_iterator_base.h \
68 backward/algo.h backward/algobase.h backward/alloc.h \
69 backward/bvector.h backward/defalloc.h backward/deque.h \
70 backward/function.h backward/hash_map.h backward/hash_set.h \
71 backward/hashtable.h backward/heap.h backward/iterator.h \
72 backward/list.h backward/map.h backward/multimap.h backward/new.h \
73 backward/multiset.h backward/pair.h backward/iostream.h \
74 backward/rope.h backward/set.h backward/slist.h backward/stack.h \
75 backward/tempbuf.h backward/tree.h backward/vector.h \
77 bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
78 bits/std_iterator.h bits/std_list.h \
79 bits/std_map.h bits/std_memory.h bits/std_numeric.h \
80 bits/std_queue.h bits/std_set.h bits/std_stack.h \
81 bits/std_stdexcept.h bits/std_vector.h \
82 bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
83 bits/stl_deque.h bits/stl_function.h \
84 bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
85 bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
86 bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
87 bits/stl_relops.h bits/stl_set.h \
88 bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h \
89 bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
90 bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
91 bits/concept_checks.h bits/container_concepts.h \
92 bits/sequence_concepts.h bits/std_strstream.h \
93 ext/ropeimpl.h ext/stl_rope.h \
94 ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h \
95 ext/stl_hashtable.h ext/stl_hash_fun.h \
96 ext/hash_map ext/hash_set ext/rope ext/slist \
100 bits/std_cassert.h bits/std_cctype.h bits/std_cerrno.h \
101 bits/std_cfloat.h bits/std_climits.h bits/std_clocale.h \
102 bits/std_cmath.h bits/std_csetjmp.h bits/std_csignal.h \
103 bits/std_cstdarg.h bits/std_cstddef.h bits/std_cstdio.h \
104 bits/std_cstdlib.h bits/std_cstring.h bits/std_ctime.h \
105 bits/std_cwchar.h bits/std_cwctype.h
108 assert.h ctype.h errno.h float.h limits.h locale.h math.h setjmp.h \
109 signal.h stdarg.h stddef.h stdio.h stdlib.h string.h time.h wchar.h \
110 wctype.h fcntl.h libio.h iolibio.h libioP.h pthread.h iconv.h \
111 bits/wrap_libio.h bits/wrap_iolibio.h bits/wrap_libioP.h \
112 bits/wrap_iconv.h bits/wrap_fcntl.h bits/wrap_pthread.h \
115 if GLIBCPP_USE_CSHADOW
116 c_headers = $(c_base_headers) $(c_shadow_headers)
118 c_headers = $(c_base_headers)
122 algorithm bitset complex deque fstream functional \
123 iomanip ios iosfwd iostream istream iterator limits list locale \
124 map memory numeric ostream queue set sstream stack stdexcept \
125 streambuf string strstream utility valarray vector \
126 cassert cctype cerrno cfloat climits clocale ciso646 \
127 cmath csetjmp csignal cstdarg cstddef cstdio cstdlib \
128 cstring ctime cwchar cwctype
130 if GLIBCPP_NEED_LIBIO
132 $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
138 $(top_builddir)/bits/std_limits.h $(top_builddir)/bits/c++config.h \
139 $(top_builddir)/bits/c++io.h $(top_builddir)/bits/c++threads.h \
140 $(top_builddir)/bits/atomicity.h $(top_builddir)/bits/os_defines.h \
141 $(top_builddir)/bits/ctype_base.h \
142 $(top_builddir)/bits/ctype_noninline.h \
143 $(top_builddir)/bits/ctype_inline.h
145 headers = $(base_headers) $(c_headers)
150 complex.cc complexf.cc complexl.cc complex_io.cc \
152 c++io.cc ios.cc stdstreams.cc strstream.cc \
153 locale.cc localename.cc codecvt.cc \
154 locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
159 VPATH += $(top_srcdir) $(top_srcdir)/src
160 VPATH += $(GLIBCPP_INCLUDE_DIR)
161 VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
163 # Actual sources for the distro, but don't build these.
164 #EXTRA_sources = string-inst.cc
166 libstdc___la_SOURCES = $(sources)
168 libinst_wstring_la_SOURCES = $(wstring_sources)
170 libstdc___la_LIBADD = \
171 ../libmath/libmath.la ../libio/libio.la \
172 ../libsupc++/libsupc++convenience.la \
175 libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
177 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
180 # Make sure cshadow headers are built first.
181 if GLIBCPP_USE_CSHADOW
182 CSHADOW_H = $(top_builddir)/stamp-cshadow
187 # Specify that all *.o's depend on this.
188 $(libstdc___la_OBJECTS): $(CSHADOW_H)
190 $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
191 $(top_srcdir)/mkcshadow
192 $(top_srcdir)/mkinclosure \
193 "-I $(top_builddir)/../../gcc/include -I /usr/include -G fcntl.h unistd.h" | $(top_srcdir)/mkcshadow;
194 rm -f $(top_builddir)/stamp-cshadow
195 echo "done" > $(top_builddir)/stamp-cshadow
198 # We cannot use the default rules to install headers since we cannot
199 # statically decide which headers to install. So we have our own special
200 # installation routine here.
201 myincludep = $(DESTDIR)$(includedir)/g++-v3/
203 install: myinstallheaders
205 # NB: As libio_headers may be empty, need this to make sure bash doesn't
206 # choke on an empty for... loop by using libio_headers_install
207 myinstallheaders: $(headers:%=$(myincludep)%)
208 if test -z "$(MULTISUBDIR)"; then \
209 for i in $(std_headers); do \
210 echo "$(INSTALL_DATA) $(GLIBCPP_INCLUDE_DIR)/std/$$i $(myincludep)";\
211 $(INSTALL_DATA) $(GLIBCPP_INCLUDE_DIR)/std/$$i $(myincludep); \
213 for i in $(build_headers); do \
214 echo "$(INSTALL_DATA) $$i $(myincludep)bits/"; \
215 $(INSTALL_DATA) $$i $(myincludep)bits/; \
217 libio_headers_install='$(libio_headers)'; \
218 for i in $$libio_headers_install; do \
219 echo "$(INSTALL_DATA) $$i $(myincludep)"; \
220 $(INSTALL_DATA) $$i $(myincludep); \
224 $(headers:%=$(myincludep)%): $(myincludep)%: %
225 if test -z "$(MULTISUBDIR)"; then \
226 $(mkinstalldirs) $(@D); \
227 echo " $(INSTALL_DATA) $^ $@"; \
228 $(INSTALL_DATA) $^ $@; \
231 # All the (now removed) machinations with string instantiations messes up the
232 # automake-generated TAGS rule. Make a simple one here.
233 TAGS: $(build_headers) $(cpu_headers)
234 etags -C $(top_srcdir)/bits/*.h $(top_srcdir)/bits/*.tcc \
235 $(build_headers) $(libio_headers) \
236 $(top_srcdir)/src/*.cc \
237 $(top_builddir)/src/limitsMEMBERS.cc $(top_builddir)/src/c++io.cc \
238 -o $(top_builddir)/TAGS
240 # We have to handle misc-inst.cc and locale-inst.cc in a special way
241 # since we cannot instantiate all classes due to missing definitions
242 # for things like vptrs, type_info bits, etc. when using
243 # -fno-implicit-templates.
244 misc-inst.o: misc-inst.cc
245 $(CXXCOMPILE) -fimplicit-templates -c $<
246 misc-inst.lo: misc-inst.cc
247 $(LTCXXCOMPILE) -fimplicit-templates -c $<
248 locale-inst.o: locale-inst.cc
249 $(CXXCOMPILE) -fimplicit-templates -c $<
250 locale-inst.lo: locale-inst.cc
251 $(LTCXXCOMPILE) -fimplicit-templates -c $<
253 # We have to instantiate wstring bits too. . .
254 wstring-inst.o: string-inst.cc
255 $(CXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
256 wstring-inst.lo: string-inst.cc
257 $(LTCXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
260 # Alexandre put this in here for some libtool-related reason.
262 libstdc++.INC: Makefile
264 top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
265 top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
270 tmp-libstdc++.INC: Makefile
271 echo -I$(top_builddir) $(INCLUDES) > $@
274 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
275 # modified in a per-library or per-sub-library way.
276 # Need to manually set this option because CONFIG_CXXFLAGS has to be at
277 # the end of the compile line so that -O2 can be overridden as the
278 # occasion call for it. (ie, --enable-debug)
280 -fno-implicit-templates \
282 $(OPTIMIZE_CXXFLAGS) \
285 # Need to explicitly set this so that AM_CXXFLAGS is last. In
286 # addition, we don't use $(DEFS), which tries to set $(top_srcdir) as
287 # an include diretory, which screws up shadow headers. (That way,
288 # things like -O2 passed down from the toplevel can be overridden by
290 CXXCOMPILE = $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
291 $(CXXFLAGS) $(AM_CXXFLAGS)
293 LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(INCLUDES) \
294 $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
296 # We have a problem when building the shared libstdc++ object if the
297 # rules automake generates would be used. We cannot allow CXX to be used
298 # in libtool since this would add -lstdc++ to the link line which of
299 # course is impossible.
300 CXXLINK = $(LIBTOOL) --mode=link "$(CC)" @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@