1## Makefile for the include subdirectory of the GNU C++ Standard library.
2##
3## Copyright (C) 2001, 2002 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
24AUTOMAKE_OPTIONS = 1.3 cygnus
25MAINT_CHARSET = latin1
26
27mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
28
29# Cross compiler and multilib support.
30CXX = @glibcpp_CXX@
31glibcpp_srcdir=@glibcpp_srcdir@
32glibcpp_builddir=@glibcpp_builddir@
33
34bits_srcdir = ${glibcpp_srcdir}/include/bits
35bits_builddir = ./bits
36bits_headers = \
37	${bits_srcdir}/basic_ios.h \
38	${bits_srcdir}/basic_ios.tcc \
39	${bits_srcdir}/basic_string.h \
40	${bits_srcdir}/basic_string.tcc \
41	${bits_srcdir}/boost_concept_check.h \
42	${bits_srcdir}/char_traits.h \
43	${bits_srcdir}/codecvt.h \
44	${bits_srcdir}/concept_check.h \
45	${bits_srcdir}/cpp_type_traits.h \
46	${bits_srcdir}/fpos.h \
47	${bits_srcdir}/fstream.tcc \
48	${bits_srcdir}/functexcept.h \
49	${bits_srcdir}/generic_shadow.h \
50	${bits_srcdir}/gslice.h \
51	${bits_srcdir}/gslice_array.h \
52	${bits_srcdir}/indirect_array.h \
53	${bits_srcdir}/ios_base.h \
54	${bits_srcdir}/istream.tcc \
55	${bits_srcdir}/locale_facets.h \
56	${bits_srcdir}/locale_facets.tcc \
57	${bits_srcdir}/localefwd.h \
58	${bits_srcdir}/mask_array.h \
59	${bits_srcdir}/ostream.tcc \
60	${bits_srcdir}/pthread_allocimpl.h \
61	${bits_srcdir}/stream_iterator.h \
62	${bits_srcdir}/streambuf_iterator.h \
63	${bits_srcdir}/slice.h \
64	${bits_srcdir}/slice_array.h \
65	${bits_srcdir}/sstream.tcc \
66	${bits_srcdir}/stl_algo.h \
67	${bits_srcdir}/stl_algobase.h \
68	${bits_srcdir}/stl_alloc.h \
69	${bits_srcdir}/stl_bvector.h \
70	${bits_srcdir}/stl_construct.h \
71	${bits_srcdir}/stl_deque.h \
72	${bits_srcdir}/stl_function.h \
73	${bits_srcdir}/stl_heap.h \
74	${bits_srcdir}/stl_iterator.h \
75	${bits_srcdir}/stl_iterator_base_funcs.h \
76	${bits_srcdir}/stl_iterator_base_types.h \
77	${bits_srcdir}/stl_list.h \
78	${bits_srcdir}/stl_map.h \
79	${bits_srcdir}/stl_multimap.h \
80	${bits_srcdir}/stl_multiset.h \
81	${bits_srcdir}/stl_numeric.h \
82	${bits_srcdir}/stl_pair.h \
83	${bits_srcdir}/stl_pthread_alloc.h \
84	${bits_srcdir}/stl_queue.h \
85	${bits_srcdir}/stl_raw_storage_iter.h \
86	${bits_srcdir}/stl_relops.h \
87	${bits_srcdir}/stl_set.h \
88	${bits_srcdir}/stl_stack.h \
89	${bits_srcdir}/stl_tempbuf.h \
90	${bits_srcdir}/stl_threads.h \
91	${bits_srcdir}/stl_tree.h \
92	${bits_srcdir}/stl_uninitialized.h \
93	${bits_srcdir}/stl_vector.h \
94	${bits_srcdir}/streambuf.tcc \
95	${bits_srcdir}/stringfwd.h \
96	${bits_srcdir}/type_traits.h \
97	${bits_srcdir}/valarray_array.h \
98	${bits_srcdir}/valarray_array.tcc \
99	${bits_srcdir}/valarray_meta.h
100
101backward_srcdir = ${glibcpp_srcdir}/include/backward
102backward_builddir = ./backward
103backward_headers = \
104	${backward_srcdir}/complex.h \
105	${backward_srcdir}/iomanip.h \
106	${backward_srcdir}/istream.h \
107	${backward_srcdir}/ostream.h \
108	${backward_srcdir}/stream.h \
109	${backward_srcdir}/streambuf.h \
110	${backward_srcdir}/algo.h \
111	${backward_srcdir}/algobase.h \
112	${backward_srcdir}/alloc.h \
113	${backward_srcdir}/bvector.h \
114	${backward_srcdir}/defalloc.h \
115	${backward_srcdir}/deque.h \
116	${backward_srcdir}/function.h \
117	${backward_srcdir}/hash_map.h \
118	${backward_srcdir}/hash_set.h \
119	${backward_srcdir}/hashtable.h \
120	${backward_srcdir}/heap.h \
121	${backward_srcdir}/iostream.h \
122	${backward_srcdir}/iterator.h \
123	${backward_srcdir}/list.h \
124	${backward_srcdir}/map.h \
125	${backward_srcdir}/multimap.h \
126	${backward_srcdir}/new.h \
127	${backward_srcdir}/multiset.h \
128	${backward_srcdir}/pair.h \
129	${backward_srcdir}/queue.h \
130	${backward_srcdir}/rope.h \
131	${backward_srcdir}/set.h \
132	${backward_srcdir}/slist.h \
133	${backward_srcdir}/stack.h \
134	${backward_srcdir}/tempbuf.h \
135	${backward_srcdir}/tree.h \
136	${backward_srcdir}/vector.h \
137	${backward_srcdir}/fstream.h \
138	${backward_srcdir}/strstream.h \
139	${backward_srcdir}/strstream \
140	${backward_srcdir}/backward_warning.h
141
142ext_srcdir = ${glibcpp_srcdir}/include/ext
143ext_builddir = ./ext
144ext_headers = \
145	${ext_srcdir}/algorithm \
146	${ext_srcdir}/enc_filebuf.h \
147	${ext_srcdir}/stdio_filebuf.h \
148	${ext_srcdir}/functional \
149	${ext_srcdir}/hash_map \
150	${ext_srcdir}/hash_set \
151	${ext_srcdir}/iterator \
152	${ext_srcdir}/memory \
153	${ext_srcdir}/numeric \
154	${ext_srcdir}/rb_tree \
155	${ext_srcdir}/rope \
156	${ext_srcdir}/ropeimpl.h \
157	${ext_srcdir}/slist \
158	${ext_srcdir}/stl_hash_fun.h \
159	${ext_srcdir}/stl_hashtable.h \
160	${ext_srcdir}/stl_rope.h
161
162# This is the common subset of files that all three "C" header models use.
163c_base_srcdir = @C_INCLUDE_DIR@
164c_base_builddir = .
165c_base_headers = \
166	${c_base_srcdir}/std_cassert.h \
167	${c_base_srcdir}/std_cctype.h \
168	${c_base_srcdir}/std_cerrno.h \
169	${c_base_srcdir}/std_cfloat.h \
170	${c_base_srcdir}/std_ciso646.h \
171	${c_base_srcdir}/std_climits.h \
172	${c_base_srcdir}/std_clocale.h \
173	${c_base_srcdir}/std_cmath.h \
174	${c_base_srcdir}/std_csetjmp.h \
175	${c_base_srcdir}/std_csignal.h \
176	${c_base_srcdir}/std_cstdarg.h \
177	${c_base_srcdir}/std_cstddef.h \
178	${c_base_srcdir}/std_cstdio.h \
179	${c_base_srcdir}/std_cstdlib.h \
180	${c_base_srcdir}/std_cstring.h \
181	${c_base_srcdir}/std_ctime.h \
182	${c_base_srcdir}/std_cwchar.h \
183	${c_base_srcdir}/std_cwctype.h
184c_base_headers_rename = \
185	cassert \
186	cctype \
187	cerrno \
188	cfloat \
189	ciso646 \
190	climits \
191	clocale \
192	cmath \
193	csetjmp \
194	csignal \
195	cstdarg \
196	cstddef \
197	cstdio \
198	cstdlib \
199	cstring \
200	ctime \
201	cwchar \
202	cwctype
203
204# "C" compatibility headers.
205c_compatibility_srcdir = ${glibcpp_srcdir}/include/c_compatibility
206c_compatibility_builddir = .
207c_compatibility_headers = \
208	${c_compatibility_srcdir}/assert.h \
209	${c_compatibility_srcdir}/ctype.h \
210	${c_compatibility_srcdir}/errno.h \
211	${c_compatibility_srcdir}/float.h \
212	${c_compatibility_srcdir}/iso646.h \
213	${c_compatibility_srcdir}/limits.h \
214	${c_compatibility_srcdir}/locale.h \
215	${c_compatibility_srcdir}/math.h \
216	${c_compatibility_srcdir}/setjmp.h \
217	${c_compatibility_srcdir}/signal.h \
218	${c_compatibility_srcdir}/stdarg.h \
219	${c_compatibility_srcdir}/stddef.h \
220	${c_compatibility_srcdir}/stdio.h \
221	${c_compatibility_srcdir}/stdlib.h \
222	${c_compatibility_srcdir}/string.h \
223	${c_compatibility_srcdir}/time.h \
224	${c_compatibility_srcdir}/wchar.h \
225	${c_compatibility_srcdir}/wctype.h
226
227# Some of the different "C" header models need extra files.
228# Some "C" header schemes require the "C" compatibility headers.
229# For --enable-cheaders=c_std
230if GLIBCPP_C_HEADERS_C_STD
231c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
232else
233c_base_headers_extra =
234endif
235
236if GLIBCPP_C_HEADERS_COMPATIBILITY
237c_compatibility_headers_extra = ${c_compatibility_headers}
238else
239c_compatibility_headers_extra =
240endif
241
242
243std_srcdir = ${glibcpp_srcdir}/include/std
244std_builddir = .
245std_headers = \
246	${std_srcdir}/std_algorithm.h \
247	${std_srcdir}/std_bitset.h \
248	${std_srcdir}/std_complex.h \
249	${std_srcdir}/std_deque.h \
250	${std_srcdir}/std_fstream.h \
251	${std_srcdir}/std_functional.h \
252	${std_srcdir}/std_iomanip.h \
253	${std_srcdir}/std_ios.h \
254	${std_srcdir}/std_iosfwd.h \
255	${std_srcdir}/std_iostream.h \
256	${std_srcdir}/std_istream.h \
257	${std_srcdir}/std_iterator.h \
258	${std_srcdir}/std_limits.h \
259	${std_srcdir}/std_list.h \
260	${std_srcdir}/std_locale.h \
261	${std_srcdir}/std_map.h \
262	${std_srcdir}/std_memory.h \
263	${std_srcdir}/std_numeric.h \
264	${std_srcdir}/std_ostream.h \
265	${std_srcdir}/std_queue.h \
266	${std_srcdir}/std_set.h \
267	${std_srcdir}/std_sstream.h \
268	${std_srcdir}/std_stack.h \
269	${std_srcdir}/std_stdexcept.h \
270	${std_srcdir}/std_streambuf.h \
271	${std_srcdir}/std_string.h \
272	${std_srcdir}/std_utility.h \
273	${std_srcdir}/std_valarray.h \
274	${std_srcdir}/std_vector.h
275# Renamed at build time.
276std_headers_rename = \
277	algorithm \
278	bitset \
279	complex \
280	deque \
281	fstream \
282	functional \
283	iomanip \
284	ios \
285	iosfwd \
286	iostream \
287	istream \
288	iterator \
289	limits \
290	list \
291	locale \
292	map \
293	memory \
294	numeric \
295	ostream \
296	queue \
297	set \
298	sstream \
299	stack \
300	stdexcept \
301	streambuf \
302	string \
303	utility \
304	valarray \
305	vector
306
307target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@
308target_builddir = ./${target_alias}/bits
309target_headers = \
310	${target_srcdir}/ctype_base.h \
311	${target_srcdir}/ctype_inline.h \
312	${target_srcdir}/ctype_noninline.h \
313	${target_srcdir}/os_defines.h \
314	${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \
315	${glibcpp_srcdir}/@CPU_LIMITS_INC_SRCDIR@/cpu_limits.h
316# These target_headers_extra files are all built with ad hoc naming rules.
317target_headers_extra = \
318	${target_builddir}/basic_file.h \
319	${target_builddir}/c++config.h \
320	${target_builddir}/c++io.h \
321	${target_builddir}/c++locale.h \
322	${target_builddir}/messages_members.h \
323	${target_builddir}/codecvt_specializations.h
324
325thread_target_headers = \
326	${target_builddir}/gthr.h \
327	${target_builddir}/gthr-single.h \
328	${target_builddir}/gthr-posix.h \
329	${target_builddir}/gthr-default.h
330
331# List of all timestamp files.  By keeping only one copy of this list, both
332# CLEANFILES and all-local are kept up-to-date.
333allstamps = \
334	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
335	stamp-backward stamp-ext \
336	${target_builddir}/stamp-target
337
338
339# Here are the rules for building the headers
340all-local: ${target_builddir}/c++config.h ${thread_target_headers} ${allstamps}
341
342# This rule is slightly different, in that we must change the name of the
343# local file from std_foo.h to foo.
344stamp-std: ${std_headers}
345	@if [ ! -d "${std_builddir}" ]; then \
346	  mkdir -p ${std_builddir} ;\
347	fi ;\
348	(cd ${std_builddir} && for h in $?; do \
349	  official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
350	  @LN_S@ $$h ./$${official_name} || true ;\
351	done) ;\
352	echo `date` > stamp-std
353
354stamp-bits: ${bits_headers}
355	@if [ ! -d "${bits_builddir}" ]; then \
356	  mkdir -p ${bits_builddir} ;\
357	fi ;\
358	(cd ${bits_builddir} && @LN_S@ $? . || true) ;\
359	echo `date` > stamp-bits
360
361stamp-c_base: ${c_base_headers} ${c_base_headers_extra}
362	@if [ ! -d "${c_base_builddir}" ]; then \
363	  mkdir -p ${c_base_builddir} ;\
364	fi ;\
365	(cd ${c_base_builddir} && for h in ${c_base_headers}; do \
366	  official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
367	  @LN_S@ $$h ./$${official_name} || true ;\
368	done) ;\
369	if [ ! -z "${c_base_headers_extra}" ]; then \
370	  (cd ${bits_builddir} && @LN_S@ ${c_base_headers_extra}  . || true) ;\
371	fi ;\
372	echo `date` > stamp-c_base
373
374stamp-c_compatibility: ${c_compatibility_headers_extra}
375	@if [ ! -d "${c_compatibility_builddir}" ]; then \
376	  mkdir -p ${c_compatibility_builddir} ;\
377	fi ;\
378	if [ ! -z "${c_compatibility_headers_extra}" ]; then \
379	  (cd ${c_compatibility_builddir} && @LN_S@ $? . || true) ;\
380	fi ;\
381	echo `date` > stamp-c_compatibility
382
383stamp-backward: ${backward_headers}
384	@if [ ! -d "${backward_builddir}" ]; then \
385	  mkdir -p ${backward_builddir} ;\
386	fi ;\
387	(cd ${backward_builddir} && @LN_S@ $? . || true) ;\
388	echo `date` > stamp-backward
389
390stamp-ext: ${ext_headers}
391	@if [ ! -d "${ext_builddir}" ]; then \
392	  mkdir -p ${ext_builddir} ;\
393	fi ;\
394	(cd ${ext_builddir} && @LN_S@ $? . || true) ;\
395	echo `date` > stamp-ext
396
397stamp-${target_alias}:
398	@if [ ! -d ${target_builddir} ]; then \
399	  mkdir -p ${target_builddir} ;\
400	  echo `date` > stamp-${target_alias} ;\
401	fi
402
403# Target includes static.
404${target_builddir}/stamp-target: ${target_headers} stamp-${target_alias}
405	@cd ${target_builddir} ;\
406	if [ ! -f stamp-target ]; then \
407	  @LN_S@ ${target_headers} . || true ;\
408	  @LN_S@ ${glibcpp_srcdir}/@BASIC_FILE_H@ basic_file.h || true ;\
409	  @LN_S@ ${glibcpp_srcdir}/@CSTDIO_H@ c++io.h || true ;\
410	  @LN_S@ ${glibcpp_srcdir}/@CLOCALE_H@ c++locale.h || true ;\
411	  @LN_S@ ${glibcpp_srcdir}/@CMESSAGES_H@ messages_members.h || true ;\
412	  @LN_S@ ${glibcpp_srcdir}/@CCODECVT_H@ codecvt_specializations.h || true ;\
413	  echo `date` > stamp-target; \
414	fi
415
416# Target includes dynamic.
417${target_builddir}/c++config.h: ${CONFIG_HEADER} \
418				${glibcpp_srcdir}/include/bits/c++config \
419				stamp-${target_alias}
420	@cat ${glibcpp_srcdir}/include/bits/c++config > $@ ;\
421	sed -e 's/HAVE_/_GLIBCPP_HAVE_/g' \
422	    -e 's/PACKAGE/_GLIBCPP_PACKAGE/g' \
423	    -e 's/VERSION/_GLIBCPP_VERSION/g' \
424	    -e 's/WORDS_/_GLIBCPP_WORDS_/g' \
425	    < ${CONFIG_HEADER} >> $@ ;\
426	echo "#endif // _CPP_CPPCONFIG_" >>$@
427
428# Target includes for threads
429glibcpp_thread_h = @glibcpp_thread_h@
430uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
431
432${target_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${target_alias}
433	sed -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCPP_\1/g' \
434	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
435	    < ${toplevel_srcdir}/gcc/gthr.h > $@
436
437${target_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \
438				  stamp-${target_alias}
439	sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
440	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
441	    < ${toplevel_srcdir}/gcc/gthr-single.h > $@
442
443${target_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
444				   stamp-${target_alias}
445	sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
446	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
447	    -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
448	    < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
449
450${target_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcpp_thread_h} \
451				   stamp-${target_alias}
452	sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
453	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCPP_\1/g' \
454	    -e 's/\(${uppercase}*WEAK\)/_GLIBCPP_\1/g' \
455	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
456	    < ${toplevel_srcdir}/gcc/${glibcpp_thread_h} > $@
457
458# For robustness sake (in light of junk files or in-source
459# configuration), copy from the build or source tree to the install
460# tree using only the human-maintained file lists and directory
461# components.  Yes, with minor differences, this is sheer duplication
462# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
463# `$(mkinstalldirs)' instead of `mkdir -p'.  In particular,
464# target_headers_extra are taken out of the build tree staging area;
465# the rest are taken from the original source tree.
466gxx_include_dir = @gxx_include_dir@
467install-data-local:
468	$(mkinstalldirs) ${gxx_include_dir}
469	$(mkinstalldirs) ${gxx_include_dir}/${bits_builddir}
470	for file in ${bits_headers}; do \
471	  $(INSTALL_DATA) $${file} ${gxx_include_dir}/${bits_builddir}; done
472	$(mkinstalldirs) ${gxx_include_dir}/${backward_builddir}
473	for file in ${backward_headers}; do \
474	  $(INSTALL_DATA) $${file} ${gxx_include_dir}/${backward_builddir}; done
475	$(mkinstalldirs) ${gxx_include_dir}/${ext_builddir}
476	for file in ${ext_headers}; do \
477	  $(INSTALL_DATA) $${file} ${gxx_include_dir}/${ext_builddir}; done
478	$(mkinstalldirs) ${gxx_include_dir}/${c_base_builddir}
479	for file in ${c_base_headers_rename}; do \
480	  $(INSTALL_DATA) ${c_base_builddir}/$${file} ${gxx_include_dir}; done
481	c_base_headers_extra_install='$(c_base_headers_extra)';\
482	for file in $$c_base_headers_extra_install; do \
483	  $(INSTALL_DATA) $$file ${gxx_include_dir}/${bits_builddir}; done
484	c_compatibility_headers_install='$(c_compatibility_headers_extra)';\
485	for file in $$c_compatibility_headers_install; do \
486	  $(INSTALL_DATA) $$file ${gxx_include_dir}; done
487	$(mkinstalldirs) ${gxx_include_dir}/${std_builddir}
488	for file in ${std_headers_rename}; do \
489	  $(INSTALL_DATA) ${std_builddir}/$${file} ${gxx_include_dir}; done
490	$(mkinstalldirs) ${gxx_include_dir}/${target_builddir}
491	for file in ${target_headers} ${target_headers_extra} \
492	 ${thread_target_headers}; do \
493	  $(INSTALL_DATA) $${file} ${gxx_include_dir}/${target_builddir}; done
494
495# By adding these files here, automake will remove them for 'make clean'
496#CLEANFILES = ${allstamps}
497
498# Stop implicit '.o' make rules from ever stomping on extensionless
499# headers, in the improbable case where some foolish, crack-addled
500# developer tries to create them via make in the include build
501# directory. (This is more of an example of how this kind of rule can
502# be made.)
503.PRECIOUS: $(std_headers_rename) $(c_base_headers_rename)
504$(std_headers_rename): ; @:
505$(c_base_headers_rename): ; @:
506