OSDN Git Service

2000-07-01 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / src / Makefile.am
1 ## Makefile for the src subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
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
24 AUTOMAKE_OPTIONS = 1.3 gnits
25 MAINT_CHARSET = latin1
26
27 # Cross compiler and multilib support.
28 # Install a library built with a cross compiler in tooldir, not libdir.
29 if USE_LIBDIR
30 toolexeclibdir = $(libdir)$(MULTISUBDIR)
31 else
32 toolexecdir = $(exec_prefix)/$(target_alias)
33 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
34 endif
35
36 toolexeclib_LTLIBRARIES = libstdc++.la
37 EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
38
39
40 # Using these options is probably a good idea for thrill-seekers. Just
41 # uncomment the lines below and make, everything else is ready to go... 
42 # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc 
43
44 # These bits are all figured out from configure. Look in acinclude.m4
45 # or configure.in to see how they are set.
46 # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
47 AC_CXXFLAGS = \
48         $(WERROR) @WFMT_FLAGS@ @CPU_FLAGS@ @EXTRA_CXX_FLAGS@ \
49         @SECTION_FLAGS@ @SECTION_LDFLAGS@ @DEBUG_FLAGS@ 
50
51 # Need to manually set this option because AC_CXXFLAGS has to be at
52 # the end of the compile line so that -O2 can be overridden as the
53 # occasion call for it. (ie, --enable-debug)
54 AM_CXXFLAGS = \
55         -D_GNU_SOURCE -fno-implicit-templates $(OPTIMIZE_CXXFLAGS) \
56         -Wall -Wno-format -W -Wwrite-strings -Winline \
57         $(AC_CXXFLAGS) 
58
59
60 # Passed down for cross compilers, canadian crosses.
61 TOPLEVEL_INCLUDES = -I$(includedir)
62
63 LIBIO_INCLUDES = @BUILD_LIBIO_INCLUDE@ -I$(top_srcdir)/libio 
64
65 CSHADOW_INCLUDES = @CSHADOWFLAGS@ @CSHADOW_INCLUDES@
66
67 CONFIG_INCLUDES = \
68         -I$(top_srcdir)/@cpu_include_dir@ \
69         -I$(top_srcdir)/@ctype_include_dir@
70
71 INCLUDES = \
72         -nostdinc++ -I$(top_srcdir) \
73         $(LIBIO_INCLUDES) $(CONFIG_INCLUDES) $(CSHADOW_INCLUDES) \
74         $(TOPLEVEL_INCLUDES)    
75
76
77 # Need to explicitly set this so that AM_CXXFLAGS is last. (That way,
78 # things like -O2 passed down from the toplevel can be overridden by
79 # --enable-debug.)
80 CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
81              $(CXXFLAGS) $(AM_CXXFLAGS) 
82
83 LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) \
84                $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
85
86 # We have a problem when building the shared libstdc++ object if the
87 # rules automake generates would be used.  We cannot allow CXX to be used
88 # in libtool since this would add -lstdc++ to the link line which of
89 # course is impossible.
90 CXXLINK = $(LIBTOOL) --mode=link "$(CC)" $(AM_CXXFLAGS) $(LDFLAGS) -o $@
91
92
93 headers = \
94         bits/cpp_type_traits.h \
95         bits/std_cctype.h bits/ctype_base.h bits/ctype_specializations.h \
96         bits/char_traits.h \
97         bits/basic_string.h bits/std_string.h  bits/string.tcc \
98         bits/generic_shadow.h bits/std_utility.h \
99         bits/std_complex.h \
100         bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
101         bits/std_valarray.h bits/mask_array.h bits/slice.h bits/slice_array.h \
102         bits/gslice.h bits/gslice_array.h bits/indirect_array.h \
103         bits/std_cassert.h bits/std_cwctype.h \
104         bits/std_cerrno.h bits/std_cfloat.h bits/std_climits.h \
105         bits/std_clocale.h bits/std_cmath.h \
106         bits/std_csetjmp.h bits/std_csignal.h bits/std_cstdarg.h \
107         bits/std_cstddef.h bits/std_cstdio.h bits/std_cstdlib.h \
108         bits/std_cstring.h bits/std_ctime.h bits/std_cwchar.h \
109         bits/std_typeinfo.h bits/std_new.h \
110         bits/std_exception.h bits/exception_support.h \
111         bits/std_fstream.h bits/std_iomanip.h \
112         bits/ios_base.h bits/fpos.h bits/basic_ios.h bits/basic_ios.tcc \
113         bits/std_ios.h bits/std_iosfwd.h bits/std_iostream.h \
114         bits/std_istream.h bits/istream.tcc bits/std_locale.h \
115         bits/fstream.tcc bits/ostream.tcc bits/sbuf_iter.h bits/sstream.tcc \
116         bits/std_ostream.h bits/std_sstream.h bits/std_streambuf.h \
117         bits/streambuf.tcc bits/basic_file.h \
118         bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
119         bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
120         bits/stl_threads.h bits/stl_iterator_base.h \
121         backward/algo.h backward/algobase.h backward/alloc.h \
122         backward/bvector.h backward/defalloc.h backward/deque.h \
123         backward/function.h backward/hash_map.h backward/hash_set.h \
124         backward/hashtable.h backward/heap.h backward/iterator.h \
125         backward/list.h backward/map.h backward/multimap.h backward/new.h \
126         backward/multiset.h backward/pair.h backward/iostream.h \
127         backward/rope.h backward/set.h backward/slist.h backward/stack.h \
128         backward/tempbuf.h backward/tree.h backward/vector.h \
129         bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
130         bits/std_iterator.h bits/std_list.h \
131         bits/std_map.h bits/std_memory.h bits/std_numeric.h \
132         bits/std_queue.h bits/std_set.h bits/std_stack.h \
133         bits/std_stdexcept.h bits/std_vector.h \
134         bits/stl_algo.h bits/stl_algobase.h bits/stl_alloc.h \
135         bits/stl_deque.h bits/stl_function.h \
136         bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
137         bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
138         bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
139         bits/stl_relops.h bits/stl_set.h \
140         bits/stl_stack.h bits/stl_string_fwd.h bits/stl_tempbuf.h \
141         bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
142         bits/type_traits.h bits/stl_range_errors.h bits/std_algorithm.h \
143         bits/concept_checks.h bits/container_concepts.h \
144         bits/sequence_concepts.h bits/std_strstream.h \
145         ext/ropeimpl.h ext/stl_rope.h \
146         ext/stl_bvector.h bits/stl_config.h bits/stl_construct.h \
147         ext/stl_hashtable.h ext/stl_hash_fun.h \
148         ext/hash_map ext/hash_set ext/rope ext/slist \
149         ext/tree ext/bvector \
150         shadow/assert.h shadow/ctype.h shadow/errno.h shadow/float.h \
151         shadow/libio.h \
152         shadow/limits.h shadow/locale.h shadow/math.h shadow/setjmp.h \
153         shadow/signal.h shadow/stdarg.h shadow/stddef.h shadow/stdio.h \
154         shadow/stdlib.h shadow/string.h shadow/time.h \
155         shadow/unistd.h shadow/wchar.h shadow/wctype.h \
156         shadow/bits/std_cassert.h shadow/bits/std_cctype.h \
157         shadow/bits/std_cerrno.h shadow/bits/std_cfloat.h \
158         shadow/bits/std_climits.h shadow/bits/std_clocale.h \
159         shadow/bits/std_cmath.h shadow/bits/std_csetjmp.h \
160         shadow/bits/std_csignal.h shadow/bits/std_cstdarg.h \
161         shadow/bits/std_cstddef.h shadow/bits/std_cstdio.h \
162         shadow/bits/std_cstdlib.h shadow/bits/std_cstring.h \
163         shadow/bits/std_ctime.h shadow/bits/std_cwchar.h \
164         shadow/bits/std_cwctype.h \
165         shadow/bits/wrap_libio.h shadow/bits/wrap_unistd.h \
166         shadow/sys/cdefs.h 
167
168 std_headers = \
169         algorithm bitset cassert cctype cerrno cfloat climits clocale ciso646 \
170         cmath complex csetjmp csignal cstdarg cstddef cstdio cstdlib \
171         cstring ctime cwchar cwctype deque exception fstream functional \
172         iomanip ios iosfwd iostream istream iterator limits list locale \
173         map memory new numeric ostream queue set sstream stack stdexcept \
174         streambuf string strstream typeinfo utility valarray vector 
175
176 if GLIBCPP_NEED_LIBIO 
177 libio_headers = \
178         $(top_builddir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
179 else
180 libio_headers =
181 endif
182
183 generated_headers = \
184          $(top_builddir)/bits/std_limits.h $(top_builddir)/bits/c++config.h \
185          $(top_builddir)/bits/c++threads.h $(top_builddir)/bits/c++io.h
186
187 cpu_headers = \
188          $(top_srcdir)/@cpu_include_dir@/bits/atomicity.h 
189
190
191 sources = \
192         limitsMEMBERS.cc c++io.cc \
193         cmath.cc \
194         complex.cc complexf.cc complexl.cc complex_io.cc \
195         stdexcept.cc ios.cc stdstreams.cc strstream.cc \
196         locale.cc localename.cc  \
197         locale-inst.cc stl-inst.cc misc-inst.cc valarray-inst.cc string-inst.cc
198
199 wstring_sources = \
200         wstring-inst.cc
201
202 VPATH += $(top_srcdir) $(top_srcdir)/std $(top_srcdir)/src
203 VPATH += $(top_srcdir)/@ctype_include_dir@
204
205
206 # Actual sources for the distro, but don't build these.
207 #EXTRA_sources = string-inst.cc 
208
209 libstdc___la_SOURCES = $(sources)
210
211 libinst_wstring_la_SOURCES = $(wstring_sources)
212
213 libstdc___la_LIBADD = \
214         ../math/libmath.la ../libio/libio.la \
215         @libinst_wstring_la@
216
217 libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
218
219 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
220
221
222 # Make sure cshadow headers are built first.
223 if GLIBCPP_USE_CSHADOW
224 CSHADOW_H = $(top_builddir)/stamp-cshadow
225 else
226 CSHADOW_H =
227 endif
228
229 # Specify that all *.o's depend on this.
230 $(libstdc___la_OBJECTS): $(CSHADOW_H)
231
232 $(top_builddir)/stamp-cshadow: $(top_srcdir)/mkinclosure \
233                                $(top_srcdir)/mkcshadow
234         $(top_srcdir)/mkinclosure \
235         "-I $(top_builddir)/../../gcc/include -I /usr/include -G machine/ansi.h" | $(top_srcdir)/mkcshadow;
236         rm -f  $(top_builddir)/stamp-cshadow 
237         echo "done" > $(top_builddir)/stamp-cshadow 
238
239
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/
244
245 install: myinstallheaders
246
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
249 myinstallheaders: $(headers:%=$(myincludep)%)
250         if test -z "$(MULTISUBDIR)"; then \
251         for i in $(std_headers); do \
252           echo "$(INSTALL_DATA) $(top_srcdir)/std/$$i $(myincludep)"; \
253                 $(INSTALL_DATA) $(top_srcdir)/std/$$i $(myincludep); \
254         done; \
255         for i in $(generated_headers); do \
256           echo "$(INSTALL_DATA) $$i $(myincludep)bits/"; \
257                 $(INSTALL_DATA) $$i $(myincludep)bits/; \
258         done; \
259         libio_headers_install='$(libio_headers)'; \
260         for i in $$libio_headers_install; do \
261           echo "$(INSTALL_DATA) $$i $(myincludep)"; \
262                 $(INSTALL_DATA) $$i $(myincludep); \
263         done; \
264         echo "$(INSTALL_DATA) $(cpu_headers) $(myincludep)bits/"; \
265         $(INSTALL_DATA) $(cpu_headers) $(myincludep)bits/; \
266         fi;
267
268 $(headers:%=$(myincludep)%): $(myincludep)%: %
269         if test -z "$(MULTISUBDIR)"; then \
270         $(mkinstalldirs) $(@D); \
271         echo " $(INSTALL_DATA) $^ $@"; \
272         $(INSTALL_DATA) $^ $@; \
273         fi;
274
275 # All the machinations with string instantiations messes up the
276 # automake-generated TAGS rule. Make a simple one here.
277 TAGS: $(generated_headers) $(cpu_headers) 
278         etags -C $(top_srcdir)/bits/*.h $(top_srcdir)/bits/*.tcc \
279         $(generated_headers) $(cpu_headers) $(libio_headers) \
280         $(top_srcdir)/src/*.cc \
281         $(top_builddir)/src/limitsMEMBERS.cc $(top_builddir)/src/c++io.cc \
282         -o $(top_builddir)/TAGS
283
284 # We have to handle misc-inst.cc and locale-inst.cc in a special way
285 # since we cannot instantiate all classes due to missing definitions
286 # for things like vptrs, type_info bits, etc. when using
287 # -fno-implicit-templates.
288 misc-inst.o: misc-inst.cc
289         $(CXXCOMPILE) -fimplicit-templates -c $<
290 misc-inst.lo: misc-inst.cc
291         $(LTCXXCOMPILE) -fimplicit-templates -c $<
292 locale-inst.o: locale-inst.cc
293         $(CXXCOMPILE) -fimplicit-templates -c $<
294 locale-inst.lo: locale-inst.cc
295         $(LTCXXCOMPILE) -fimplicit-templates -c $<
296
297 # We have to instantiate wstring bits too. . . 
298 wstring-inst.o: string-inst.cc
299         $(CXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
300 wstring-inst.lo: string-inst.cc
301         $(LTCXXCOMPILE) -fimplicit-templates -c -DC=wchar_t $< -o $@
302