1## Makefile for the include subdirectory of the GNU C++ Standard library.
2##
3## Copyright (C) 2001, 2002, 2003, 2004 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
24include $(top_srcdir)/fragment.am
25
26# Standard C++ includes.
27std_srcdir = ${glibcxx_srcdir}/include/std
28std_builddir = .
29std_headers = \
30	${std_srcdir}/std_algorithm.h \
31	${std_srcdir}/std_bitset.h \
32	${std_srcdir}/std_complex.h \
33	${std_srcdir}/std_deque.h \
34	${std_srcdir}/std_fstream.h \
35	${std_srcdir}/std_functional.h \
36	${std_srcdir}/std_iomanip.h \
37	${std_srcdir}/std_ios.h \
38	${std_srcdir}/std_iosfwd.h \
39	${std_srcdir}/std_iostream.h \
40	${std_srcdir}/std_istream.h \
41	${std_srcdir}/std_iterator.h \
42	${std_srcdir}/std_limits.h \
43	${std_srcdir}/std_list.h \
44	${std_srcdir}/std_locale.h \
45	${std_srcdir}/std_map.h \
46	${std_srcdir}/std_memory.h \
47	${std_srcdir}/std_numeric.h \
48	${std_srcdir}/std_ostream.h \
49	${std_srcdir}/std_queue.h \
50	${std_srcdir}/std_set.h \
51	${std_srcdir}/std_sstream.h \
52	${std_srcdir}/std_stack.h \
53	${std_srcdir}/std_stdexcept.h \
54	${std_srcdir}/std_streambuf.h \
55	${std_srcdir}/std_string.h \
56	${std_srcdir}/std_utility.h \
57	${std_srcdir}/std_valarray.h \
58	${std_srcdir}/std_vector.h
59# Renamed at build time.
60std_headers_rename = \
61	algorithm \
62	bitset \
63	complex \
64	deque \
65	fstream \
66	functional \
67	iomanip \
68	ios \
69	iosfwd \
70	iostream \
71	istream \
72	iterator \
73	limits \
74	list \
75	locale \
76	map \
77	memory \
78	numeric \
79	ostream \
80	queue \
81	set \
82	sstream \
83	stack \
84	stdexcept \
85	streambuf \
86	string \
87	utility \
88	valarray \
89	vector
90
91bits_srcdir = ${glibcxx_srcdir}/include/bits
92bits_builddir = ./bits
93bits_headers = \
94	${bits_srcdir}/allocator.h \
95	${bits_srcdir}/atomicity.h \
96	${bits_srcdir}/basic_ios.h \
97	${bits_srcdir}/basic_ios.tcc \
98	${bits_srcdir}/basic_string.h \
99	${bits_srcdir}/basic_string.tcc \
100	${bits_srcdir}/boost_concept_check.h \
101	${bits_srcdir}/char_traits.h \
102	${bits_srcdir}/codecvt.h \
103	${bits_srcdir}/concept_check.h \
104	${bits_srcdir}/concurrence.h \
105	${bits_srcdir}/cpp_type_traits.h \
106	${bits_srcdir}/deque.tcc \
107	${bits_srcdir}/fstream.tcc \
108	${bits_srcdir}/functexcept.h \
109	${bits_srcdir}/gslice.h \
110	${bits_srcdir}/gslice_array.h \
111	${bits_srcdir}/indirect_array.h \
112	${bits_srcdir}/ios_base.h \
113	${bits_srcdir}/istream.tcc \
114	${bits_srcdir}/list.tcc \
115	${bits_srcdir}/locale_classes.h \
116	${bits_srcdir}/locale_facets.h \
117	${bits_srcdir}/locale_facets.tcc \
118	${bits_srcdir}/localefwd.h \
119	${bits_srcdir}/mask_array.h \
120	${bits_srcdir}/ostream.tcc \
121	${bits_srcdir}/postypes.h \
122	${bits_srcdir}/stream_iterator.h \
123	${bits_srcdir}/streambuf_iterator.h \
124	${bits_srcdir}/slice_array.h \
125	${bits_srcdir}/sstream.tcc \
126	${bits_srcdir}/stl_algo.h \
127	${bits_srcdir}/stl_algobase.h \
128	${bits_srcdir}/stl_bvector.h \
129	${bits_srcdir}/stl_construct.h \
130	${bits_srcdir}/stl_deque.h \
131	${bits_srcdir}/stl_function.h \
132	${bits_srcdir}/stl_heap.h \
133	${bits_srcdir}/stl_iterator.h \
134	${bits_srcdir}/stl_iterator_base_funcs.h \
135	${bits_srcdir}/stl_iterator_base_types.h \
136	${bits_srcdir}/stl_list.h \
137	${bits_srcdir}/stl_map.h \
138	${bits_srcdir}/stl_multimap.h \
139	${bits_srcdir}/stl_multiset.h \
140	${bits_srcdir}/stl_numeric.h \
141	${bits_srcdir}/stl_pair.h \
142	${bits_srcdir}/stl_queue.h \
143	${bits_srcdir}/stl_raw_storage_iter.h \
144	${bits_srcdir}/stl_relops.h \
145	${bits_srcdir}/stl_set.h \
146	${bits_srcdir}/stl_stack.h \
147	${bits_srcdir}/stl_tempbuf.h \
148	${bits_srcdir}/stl_threads.h \
149	${bits_srcdir}/stl_tree.h \
150	${bits_srcdir}/stl_uninitialized.h \
151	${bits_srcdir}/stl_vector.h \
152	${bits_srcdir}/streambuf.tcc \
153	${bits_srcdir}/stringfwd.h \
154	${bits_srcdir}/type_traits.h \
155	${bits_srcdir}/valarray_array.h \
156	${bits_srcdir}/valarray_array.tcc \
157	${bits_srcdir}/valarray_before.h \
158	${bits_srcdir}/valarray_after.h \
159	${bits_srcdir}/vector.tcc
160
161backward_srcdir = ${glibcxx_srcdir}/include/backward
162backward_builddir = ./backward
163backward_headers = \
164	${backward_srcdir}/complex.h \
165	${backward_srcdir}/iomanip.h \
166	${backward_srcdir}/istream.h \
167	${backward_srcdir}/ostream.h \
168	${backward_srcdir}/stream.h \
169	${backward_srcdir}/streambuf.h \
170	${backward_srcdir}/algo.h \
171	${backward_srcdir}/algobase.h \
172	${backward_srcdir}/alloc.h \
173	${backward_srcdir}/bvector.h \
174	${backward_srcdir}/defalloc.h \
175	${backward_srcdir}/deque.h \
176	${backward_srcdir}/function.h \
177	${backward_srcdir}/hash_map.h \
178	${backward_srcdir}/hash_set.h \
179	${backward_srcdir}/hashtable.h \
180	${backward_srcdir}/heap.h \
181	${backward_srcdir}/iostream.h \
182	${backward_srcdir}/iterator.h \
183	${backward_srcdir}/list.h \
184	${backward_srcdir}/map.h \
185	${backward_srcdir}/multimap.h \
186	${backward_srcdir}/new.h \
187	${backward_srcdir}/multiset.h \
188	${backward_srcdir}/pair.h \
189	${backward_srcdir}/queue.h \
190	${backward_srcdir}/rope.h \
191	${backward_srcdir}/set.h \
192	${backward_srcdir}/slist.h \
193	${backward_srcdir}/stack.h \
194	${backward_srcdir}/tempbuf.h \
195	${backward_srcdir}/tree.h \
196	${backward_srcdir}/vector.h \
197	${backward_srcdir}/fstream.h \
198	${backward_srcdir}/strstream \
199	${backward_srcdir}/backward_warning.h
200
201ext_srcdir = ${glibcxx_srcdir}/include/ext
202ext_builddir = ./ext
203ext_headers = \
204	${ext_srcdir}/algorithm \
205	${ext_srcdir}/bitmap_allocator.h \
206	${ext_srcdir}/debug_allocator.h \
207	${ext_srcdir}/demangle.h \
208	${ext_srcdir}/enc_filebuf.h \
209	${ext_srcdir}/stdio_filebuf.h \
210	${ext_srcdir}/stdio_sync_filebuf.h \
211	${ext_srcdir}/functional \
212	${ext_srcdir}/hash_map \
213	${ext_srcdir}/hash_set \
214	${ext_srcdir}/iterator \
215	${ext_srcdir}/malloc_allocator.h \
216	${ext_srcdir}/memory \
217	${ext_srcdir}/mt_allocator.h \
218	${ext_srcdir}/new_allocator.h \
219	${ext_srcdir}/numeric \
220	${ext_srcdir}/pod_char_traits.h \
221	${ext_srcdir}/pool_allocator.h \
222	${ext_srcdir}/rb_tree \
223	${ext_srcdir}/rope \
224	${ext_srcdir}/ropeimpl.h \
225	${ext_srcdir}/slist \
226	${ext_srcdir}/hash_fun.h \
227	${ext_srcdir}/hashtable.h
228
229# This is the common subset of files that all three "C" header models use.
230c_base_srcdir = $(C_INCLUDE_DIR)
231c_base_builddir = .
232c_base_headers = \
233	${c_base_srcdir}/std_cassert.h \
234	${c_base_srcdir}/std_cctype.h \
235	${c_base_srcdir}/std_cerrno.h \
236	${c_base_srcdir}/std_cfloat.h \
237	${c_base_srcdir}/std_ciso646.h \
238	${c_base_srcdir}/std_climits.h \
239	${c_base_srcdir}/std_clocale.h \
240	${c_base_srcdir}/std_cmath.h \
241	${c_base_srcdir}/std_csetjmp.h \
242	${c_base_srcdir}/std_csignal.h \
243	${c_base_srcdir}/std_cstdarg.h \
244	${c_base_srcdir}/std_cstddef.h \
245	${c_base_srcdir}/std_cstdio.h \
246	${c_base_srcdir}/std_cstdlib.h \
247	${c_base_srcdir}/std_cstring.h \
248	${c_base_srcdir}/std_ctime.h \
249	${c_base_srcdir}/std_cwchar.h \
250	${c_base_srcdir}/std_cwctype.h
251c_base_headers_rename = \
252	cassert \
253	cctype \
254	cerrno \
255	cfloat \
256	ciso646 \
257	climits \
258	clocale \
259	cmath \
260	csetjmp \
261	csignal \
262	cstdarg \
263	cstddef \
264	cstdio \
265	cstdlib \
266	cstring \
267	ctime \
268	cwchar \
269	cwctype
270
271# "C" compatibility headers.
272c_compatibility_srcdir = ${glibcxx_srcdir}/include/c_compatibility
273c_compatibility_builddir = .
274c_compatibility_headers = \
275	${c_compatibility_srcdir}/assert.h \
276	${c_compatibility_srcdir}/ctype.h \
277	${c_compatibility_srcdir}/errno.h \
278	${c_compatibility_srcdir}/float.h \
279	${c_compatibility_srcdir}/iso646.h \
280	${c_compatibility_srcdir}/limits.h \
281	${c_compatibility_srcdir}/locale.h \
282	${c_compatibility_srcdir}/math.h \
283	${c_compatibility_srcdir}/setjmp.h \
284	${c_compatibility_srcdir}/signal.h \
285	${c_compatibility_srcdir}/stdarg.h \
286	${c_compatibility_srcdir}/stddef.h \
287	${c_compatibility_srcdir}/stdio.h \
288	${c_compatibility_srcdir}/stdlib.h \
289	${c_compatibility_srcdir}/string.h \
290	${c_compatibility_srcdir}/time.h \
291	${c_compatibility_srcdir}/wchar.h \
292	${c_compatibility_srcdir}/wctype.h
293
294# Debug mode headers
295debug_srcdir = ${glibcxx_srcdir}/include/debug
296debug_builddir = ./debug
297debug_headers = \
298	${debug_srcdir}/bitset \
299	${debug_srcdir}/debug.h \
300	${debug_srcdir}/deque \
301	${debug_srcdir}/formatter.h \
302	${debug_srcdir}/hash_map \
303	${debug_srcdir}/hash_map.h \
304	${debug_srcdir}/hash_multimap.h \
305	${debug_srcdir}/hash_multiset.h \
306	${debug_srcdir}/hash_set \
307	${debug_srcdir}/hash_set.h \
308	${debug_srcdir}/list \
309	${debug_srcdir}/map \
310	${debug_srcdir}/map.h \
311	${debug_srcdir}/multimap.h \
312	${debug_srcdir}/multiset.h \
313	${debug_srcdir}/safe_base.h \
314	${debug_srcdir}/safe_iterator.h \
315	${debug_srcdir}/safe_iterator.tcc \
316	${debug_srcdir}/safe_sequence.h \
317	${debug_srcdir}/set \
318	${debug_srcdir}/set.h \
319	${debug_srcdir}/string \
320	${debug_srcdir}/vector
321
322# Some of the different "C" header models need extra files.
323# Some "C" header schemes require the "C" compatibility headers.
324# For --enable-cheaders=c_std
325if GLIBCXX_C_HEADERS_C_STD
326c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
327else
328c_base_headers_extra =
329endif
330
331if GLIBCXX_C_HEADERS_COMPATIBILITY
332c_compatibility_headers_extra = ${c_compatibility_headers}
333else
334c_compatibility_headers_extra =
335endif
336
337host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
338host_builddir = ./${host_alias}/bits
339host_headers = \
340	${host_srcdir}/ctype_base.h \
341	${host_srcdir}/ctype_inline.h \
342	${host_srcdir}/ctype_noninline.h \
343	${host_srcdir}/os_defines.h \
344	${glibcxx_srcdir}/$(ATOMIC_WORD_SRCDIR)/atomic_word.h
345
346# Non-installed host_header files.
347host_headers_noinst = \
348	${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H)
349
350# These host_headers_extra files are all built with ad hoc naming rules.
351host_headers_extra = \
352	${host_builddir}/basic_file.h \
353	${host_builddir}/c++config.h \
354	${host_builddir}/c++allocator.h \
355	${host_builddir}/c++io.h \
356	${host_builddir}/c++locale.h \
357	${host_builddir}/messages_members.h \
358	${host_builddir}/time_members.h \
359	${host_builddir}/codecvt_specializations.h
360
361thread_host_headers = \
362	${host_builddir}/gthr.h \
363	${host_builddir}/gthr-single.h \
364	${host_builddir}/gthr-posix.h \
365	${host_builddir}/gthr-default.h
366
367pch_input = ${host_builddir}/stdc++.h
368pch_output_builddir = ${host_builddir}/stdc++.h.gch
369pch_source = ${glibcxx_srcdir}/include/stdc++.h
370PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
371if GLIBCXX_BUILD_PCH
372pch_build = ${pch_input}
373pch_install = install-pch
374else
375pch_build =
376pch_install =
377endif
378
379# List of all timestamp files.  By keeping only one copy of this list, both
380# CLEANFILES and all-local are kept up-to-date.
381allstamped = \
382	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
383	stamp-backward stamp-ext stamp-debug stamp-host
384
385# List of all files that are created by explicit building, editing, or
386# catenation.
387allcreated = \
388	${host_builddir}/c++config.h \
389	${thread_host_headers} \
390	${pch_build}
391
392# Here are the rules for building the headers
393all-local: ${allstamped} ${allcreated}
394
395# This rule is slightly different, in that we must change the name of the
396# local file from std_foo.h to foo.
397stamp-std: ${std_headers}
398	@if [ ! -d "${std_builddir}" ]; then \
399	  mkdir -p ${std_builddir} ;\
400	fi ;\
401	if [ ! -f stamp-std ]; then \
402	  (cd ${std_builddir} && for h in $?; do \
403	    official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
404	    $(LN_S) $$h ./$${official_name} || true ;\
405	  done) ;\
406	fi ;\
407	$(STAMP) stamp-std
408
409stamp-bits: ${bits_headers}
410	@if [ ! -d "${bits_builddir}" ]; then \
411	  mkdir -p ${bits_builddir} ;\
412	fi ;\
413	if [ ! -f stamp-bits ]; then \
414	  (cd ${bits_builddir} && $(LN_S) $? . || true) ;\
415	fi ;\
416	$(STAMP) stamp-bits
417
418stamp-c_base: stamp-bits ${c_base_headers} ${c_base_headers_extra}
419	@if [ ! -d "${c_base_builddir}" ]; then \
420	  mkdir -p ${c_base_builddir} ;\
421	fi ;\
422	if [ ! -f stamp-c_base ]; then \
423	  (cd ${c_base_builddir} && for h in ${c_base_headers}; do \
424	    official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
425	    $(LN_S) $$h ./$${official_name} || true ;\
426	  done) ;\
427	  if [ ! -z "${c_base_headers_extra}" ]; then \
428	  (cd ${bits_builddir} && $(LN_S) ${c_base_headers_extra}  . || true) ;\
429	  fi ;\
430	fi ;\
431	$(STAMP) stamp-c_base
432
433stamp-c_compatibility: ${c_compatibility_headers_extra}
434	@if [ ! -d "${c_compatibility_builddir}" ]; then \
435	  mkdir -p ${c_compatibility_builddir} ;\
436	fi ;\
437	if [ ! -f stamp-c_compatibility ]; then \
438	  if [ ! -z "${c_compatibility_headers_extra}" ]; then \
439	    (cd ${c_compatibility_builddir} && $(LN_S) $? . || true) ;\
440	  fi ;\
441	fi ;\
442	$(STAMP) stamp-c_compatibility
443
444stamp-backward: ${backward_headers}
445	@if [ ! -d "${backward_builddir}" ]; then \
446	  mkdir -p ${backward_builddir} ;\
447	fi ;\
448	if [ ! -f stamp-backward ]; then \
449	  (cd ${backward_builddir} && $(LN_S) $? . || true) ;\
450	fi ;\
451	$(STAMP) stamp-backward
452
453stamp-ext: ${ext_headers}
454	@if [ ! -d "${ext_builddir}" ]; then \
455	    mkdir -p ${ext_builddir} ;\
456	fi ;\
457	if [ ! -f stamp-ext ]; then \
458	  (cd ${ext_builddir} && $(LN_S) $? . || true) ;\
459	fi ;\
460	$(STAMP) stamp-ext
461
462stamp-debug: ${debug_headers}
463	@if [ ! -d "${debug_builddir}" ]; then \
464	  mkdir -p ${debug_builddir} ;\
465	fi ;\
466	if [ ! -f stamp-debug ]; then \
467	  (cd ${debug_builddir} && @LN_S@ $? . || true) ;\
468	fi ;\
469	$(STAMP) stamp-debug
470
471stamp-${host_alias}:
472	@if [ ! -d ${host_builddir} ]; then \
473	  mkdir -p ${host_builddir} ;\
474	fi ;\
475	$(STAMP) stamp-${host_alias}
476
477# Host includes static.
478# XXX Missing dependency info for {host_headers_extra}
479stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
480	@if [ ! -f stamp-host ]; then \
481	  (cd ${host_builddir} ;\
482	  $(LN_S) ${host_headers} . || true ;\
483	  $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\
484	  $(LN_S) ${glibcxx_srcdir}/$(ALLOCATOR_H) c++allocator.h || true ;\
485	  $(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\
486	  $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_H) c++locale.h || true ;\
487	  $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H) . || true ;\
488	  $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
489	  $(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true ;\
490	  $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_H) codecvt_specializations.h || true);\
491	fi ;\
492	$(STAMP) stamp-host
493
494# Host includes dynamic.
495${host_builddir}/c++config.h: ${top_builddir}/config.h \
496				${glibcxx_srcdir}/include/bits/c++config \
497				stamp-${host_alias}
498	@cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
499	sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
500	    -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
501	    -e 's/VERSION/_GLIBCXX_VERSION/g' \
502	    -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
503	    < ${CONFIG_HEADER} >> $@ ;\
504	echo "#endif // _CXXCONFIG_" >>$@
505
506# Host includes for threads
507uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
508
509${host_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${host_alias}
510	sed -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
511	    -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
512	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
513	    < ${toplevel_srcdir}/gcc/gthr.h > $@
514
515${host_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \
516				  stamp-${host_alias}
517	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
518	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
519	    < ${toplevel_srcdir}/gcc/gthr-single.h > $@
520
521${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
522				   stamp-${host_alias}
523	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
524	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
525	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
526	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
527	    < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
528
529${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
530				   stamp-${host_alias}
531	sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
532	    -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
533	    -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
534	    -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
535	    -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
536	    < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
537
538# Build a precompiled C++ include, stdc++.h.gch.
539${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
540	touch ${pch_input}; \
541	if [ ! -d "${pch_output_builddir}" ]; then \
542	  mkdir -p ${pch_output_builddir}; \
543	fi; \
544	$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
545	$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
546
547# For robustness sake (in light of junk files or in-source
548# configuration), copy from the build or source tree to the install
549# tree using only the human-maintained file lists and directory
550# components.  Yes, with minor differences, this is sheer duplication
551# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
552# `$(mkinstalldirs)' instead of `mkdir -p'.  In particular,
553# host_headers_extra are taken out of the build tree staging area;
554# the rest are taken from the original source tree.
555
556if GLIBCXX_HOSTED
557install-data-local: install-headers ${pch_install}
558else
559install-data-local: install-freestanding-headers
560endif
561
562# This is a subset of the full install-headers rule.  We only need <cstddef>,
563# <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
564# files which they include (and which we provide).  The last three headers
565# are installed by libsupc++, so only the first four and the sub-includes
566# are copied here.
567install-freestanding-headers:
568	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
569	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
570	for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
571	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
572	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
573	$(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
574	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
575	for file in cstddef cstdlib cstdarg; do \
576	  $(INSTALL_DATA) ${c_base_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
577
578# The real deal.
579install-headers:
580	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
581	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${bits_builddir}
582	for file in ${bits_headers}; do \
583	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${bits_builddir}; done
584	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${backward_builddir}
585	for file in ${backward_headers}; do \
586	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${backward_builddir}; done
587	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${ext_builddir}
588	for file in ${ext_headers}; do \
589	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${ext_builddir}; done
590	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
591	for file in ${c_base_headers_rename}; do \
592	  $(INSTALL_DATA) ${c_base_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
593	c_base_headers_extra_install='$(c_base_headers_extra)';\
594	for file in $$c_base_headers_extra_install; do \
595	  $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${bits_builddir}; done
596	c_compatibility_headers_install='$(c_compatibility_headers_extra)';\
597	for file in $$c_compatibility_headers_install; do \
598	  $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}; done
599	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
600	for file in ${std_headers_rename}; do \
601	  $(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
602	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
603	for file in ${debug_headers}; do \
604	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
605	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
606	for file in ${host_headers} ${host_headers_extra} \
607	 ${thread_host_headers}; do \
608	  $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
609
610install-pch:
611	$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
612	for file in ${pch_output_builddir}/*; do \
613	  $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
614
615# By adding these files here, automake will remove them for 'make clean'
616CLEANFILES = ${pch_input} ${pch_output_builddir}/*
617
618# Stop implicit '.o' make rules from ever stomping on extensionless
619# headers, in the improbable case where some foolish, crack-addled
620# developer tries to create them via make in the include build
621# directory. (This is more of an example of how this kind of rule can
622# be made.)
623.PRECIOUS: $(std_headers_rename) $(c_base_headers_rename)
624$(std_headers_rename): ; @:
625$(c_base_headers_rename): ; @:
626