OSDN Git Service

2000-10-10 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 ## $Id: Makefile.am,v 1.37 2000/10/09 08:55:06 bkoz Exp $
25
26 AUTOMAKE_OPTIONS = 1.3 gnits
27 MAINT_CHARSET = latin1
28
29 # Cross compiler and multilib support.
30 # Install a library built with a cross compiler in tooldir, not libdir.
31 if USE_LIBDIR
32 toolexeclibdir = $(libdir)$(MULTISUBDIR)
33 else
34 toolexecdir = $(exec_prefix)/$(target_alias)
35 toolexeclibdir = $(toolexecdir)/lib$(MULTISUBDIR)
36 endif
37
38
39 toolexeclib_LTLIBRARIES = libstdc++.la
40 EXTRA_LTLIBRARIES = libinst-string.la libinst-wstring.la
41
42
43 INCLUDES = \
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) \
47         $(TOPLEVEL_INCLUDES)    
48
49 base_headers = \
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 \
53         bits/std_complex.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 \
76         backward/fstream.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 \
97         ext/tree ext/bvector 
98
99 c_base_headers = \
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 
106
107 c_shadow_headers = \
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 \
113         sys/cdefs.h 
114
115 if GLIBCPP_USE_CSHADOW
116 c_headers = $(c_base_headers) $(c_shadow_headers)
117 else
118 c_headers = $(c_base_headers)
119 endif
120
121 std_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
129
130 if GLIBCPP_NEED_LIBIO 
131 libio_headers = \
132         $(top_srcdir)/libio/_G_config.h $(top_srcdir)/libio/libio.h
133 else
134 libio_headers =
135 endif
136
137 build_headers = \
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 
144
145 headers = $(base_headers) $(c_headers)
146
147 sources = \
148         limitsMEMBERS.cc \
149         cmath.cc \
150         complex.cc complexf.cc complexl.cc complex_io.cc \
151         stdexcept.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
155
156 wstring_sources = \
157         wstring-inst.cc
158
159 VPATH += $(top_srcdir) $(top_srcdir)/src
160 VPATH += $(GLIBCPP_INCLUDE_DIR) 
161 VPATH += $(GLIBCPP_INCLUDE_DIR)/std $(C_INCLUDE_DIR)
162
163 # Actual sources for the distro, but don't build these.
164 #EXTRA_sources = string-inst.cc 
165
166 libstdc___la_SOURCES = $(sources)
167
168 libinst_wstring_la_SOURCES = $(wstring_sources)
169
170 libstdc___la_LIBADD = \
171         ../libmath/libmath.la ../libio/libio.la \
172         ../libsupc++/libsupc++convenience.la \
173         @libinst_wstring_la@
174
175 libstdc___la_LDFLAGS = -version-info 3:0:0 -lm
176
177 libstdc___la_DEPENDENCIES = $(libstdc___la_LIBADD)
178
179
180 # Make sure cshadow headers are built first.
181 if GLIBCPP_USE_CSHADOW
182 CSHADOW_H = $(top_builddir)/stamp-cshadow
183 else
184 CSHADOW_H =
185 endif
186
187 # Specify that all *.o's depend on this.
188 $(libstdc___la_OBJECTS): $(CSHADOW_H)
189
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 
196
197
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/
202
203 install: myinstallheaders
204
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); \
212         done; \
213         for i in $(build_headers); do \
214           echo "$(INSTALL_DATA) $$i $(myincludep)bits/"; \
215                 $(INSTALL_DATA) $$i $(myincludep)bits/; \
216         done; \
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); \
221         done; \
222         fi;
223
224 $(headers:%=$(myincludep)%): $(myincludep)%: %
225         if test -z "$(MULTISUBDIR)"; then \
226         $(mkinstalldirs) $(@D); \
227         echo " $(INSTALL_DATA) $^ $@"; \
228         $(INSTALL_DATA) $^ $@; \
229         fi;
230
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
239
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 $<
252
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 $@
258
259
260 # Alexandre put this in here for some libtool-related reason.
261 all: libstdc++.INC
262 libstdc++.INC: Makefile
263         $(MAKE) \
264           top_builddir=`CDPATH=:. && cd $(top_builddir) && pwd` \
265           top_srcdir=`CDPATH=:. && cd $(top_srcdir) && pwd` \
266           tmp-$@
267         -rm -f $@
268         mv tmp-$@ $@
269
270 tmp-libstdc++.INC: Makefile
271         echo -I$(top_builddir) $(INCLUDES) > $@
272
273
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)
279 AM_CXXFLAGS = \
280         -fno-implicit-templates \
281         $(WARN_CXXFLAGS) \
282         $(OPTIMIZE_CXXFLAGS) \
283         $(CONFIG_CXXFLAGS) 
284
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
289 # --enable-debug.)
290 CXXCOMPILE = $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
291              $(CXXFLAGS) $(AM_CXXFLAGS) 
292
293 LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(INCLUDES) \
294                $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) 
295
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 $@
301
302
303
304
305
306
307
308
309
310