]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/Makefile.am
Daily bump.
[thirdparty/gcc.git] / libstdc++-v3 / include / Makefile.am
CommitLineData
4a9d5109
SW
1## Makefile for the include subdirectory of the GNU C++ Standard library.
2##
ba9d552e 3## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
4a9d5109
SW
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
0df3f383 24include $(top_srcdir)/fragment.am
ab77073f
BK
25
26# Standard C++ includes.
3d7c150e 27std_srcdir = ${glibcxx_srcdir}/include/std
ab77073f
BK
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
82ba99d5 59# Renamed at build time.
ab77073f
BK
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
3d7c150e 91bits_srcdir = ${glibcxx_srcdir}/include/bits
4a9d5109
SW
92bits_builddir = ./bits
93bits_headers = \
1ff9402d 94 ${bits_srcdir}/allocator.h \
2c5d0ae8 95 ${bits_srcdir}/atomicity.h \
4a9d5109
SW
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 \
3fe13738 104 ${bits_srcdir}/concurrence.h \
4a9d5109 105 ${bits_srcdir}/cpp_type_traits.h \
83144cfc 106 ${bits_srcdir}/deque.tcc \
4a9d5109
SW
107 ${bits_srcdir}/fstream.tcc \
108 ${bits_srcdir}/functexcept.h \
4a9d5109
SW
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 \
83144cfc 114 ${bits_srcdir}/list.tcc \
e6686813 115 ${bits_srcdir}/locale_classes.h \
4a9d5109
SW
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 \
4c4809c1 121 ${bits_srcdir}/postypes.h \
4a9d5109
SW
122 ${bits_srcdir}/stream_iterator.h \
123 ${bits_srcdir}/streambuf_iterator.h \
4a9d5109
SW
124 ${bits_srcdir}/slice_array.h \
125 ${bits_srcdir}/sstream.tcc \
4a9d5109
SW
126 ${bits_srcdir}/stl_algo.h \
127 ${bits_srcdir}/stl_algobase.h \
4a9d5109
SW
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 \
4a9d5109
SW
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 \
c13bea50
NS
157 ${bits_srcdir}/valarray_before.h \
158 ${bits_srcdir}/valarray_after.h \
83144cfc 159 ${bits_srcdir}/vector.tcc
4a9d5109 160
3d7c150e 161backward_srcdir = ${glibcxx_srcdir}/include/backward
4a9d5109
SW
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 \
9a56333e 198 ${backward_srcdir}/strstream \
4a9d5109
SW
199 ${backward_srcdir}/backward_warning.h
200
3d7c150e 201ext_srcdir = ${glibcxx_srcdir}/include/ext
4a9d5109
SW
202ext_builddir = ./ext
203ext_headers = \
2c1bc4eb 204 ${ext_srcdir}/algorithm \
1ff9402d 205 ${ext_srcdir}/debug_allocator.h \
40fcf31b 206 ${ext_srcdir}/demangle.h \
5cdd50a5
BK
207 ${ext_srcdir}/enc_filebuf.h \
208 ${ext_srcdir}/stdio_filebuf.h \
51ff8149 209 ${ext_srcdir}/stdio_sync_filebuf.h \
01b0d4b8 210 ${ext_srcdir}/functional \
3d90ff93
PE
211 ${ext_srcdir}/hash_map \
212 ${ext_srcdir}/hash_set \
213 ${ext_srcdir}/iterator \
1ff9402d 214 ${ext_srcdir}/malloc_allocator.h \
f53d0ff1 215 ${ext_srcdir}/memory \
1ff9402d
BK
216 ${ext_srcdir}/mt_allocator.h \
217 ${ext_srcdir}/new_allocator.h \
01b0d4b8 218 ${ext_srcdir}/numeric \
9e7facfd 219 ${ext_srcdir}/pod_char_traits.h \
1ff9402d 220 ${ext_srcdir}/pool_allocator.h \
3b007b5d 221 ${ext_srcdir}/rb_tree \
4a9d5109
SW
222 ${ext_srcdir}/rope \
223 ${ext_srcdir}/ropeimpl.h \
4a9d5109 224 ${ext_srcdir}/slist \
b2acb86f 225 ${ext_srcdir}/hash_fun.h \
82ba99d5 226 ${ext_srcdir}/hashtable.h
b2acb86f 227
4a9d5109 228# This is the common subset of files that all three "C" header models use.
ca618b60 229c_base_srcdir = $(C_INCLUDE_DIR)
73249e33 230c_base_builddir = .
4a9d5109 231c_base_headers = \
c5535768
BK
232 ${c_base_srcdir}/std_cassert.h \
233 ${c_base_srcdir}/std_cctype.h \
234 ${c_base_srcdir}/std_cerrno.h \
235 ${c_base_srcdir}/std_cfloat.h \
236 ${c_base_srcdir}/std_ciso646.h \
237 ${c_base_srcdir}/std_climits.h \
238 ${c_base_srcdir}/std_clocale.h \
239 ${c_base_srcdir}/std_cmath.h \
240 ${c_base_srcdir}/std_csetjmp.h \
241 ${c_base_srcdir}/std_csignal.h \
242 ${c_base_srcdir}/std_cstdarg.h \
243 ${c_base_srcdir}/std_cstddef.h \
244 ${c_base_srcdir}/std_cstdio.h \
245 ${c_base_srcdir}/std_cstdlib.h \
246 ${c_base_srcdir}/std_cstring.h \
247 ${c_base_srcdir}/std_ctime.h \
248 ${c_base_srcdir}/std_cwchar.h \
82ba99d5 249 ${c_base_srcdir}/std_cwctype.h
c5535768
BK
250c_base_headers_rename = \
251 cassert \
252 cctype \
253 cerrno \
254 cfloat \
255 ciso646 \
256 climits \
257 clocale \
258 cmath \
259 csetjmp \
260 csignal \
261 cstdarg \
262 cstddef \
263 cstdio \
264 cstdlib \
265 cstring \
266 ctime \
267 cwchar \
82ba99d5 268 cwctype
4a9d5109 269
e01c9849 270# "C" compatibility headers.
3d7c150e 271c_compatibility_srcdir = ${glibcxx_srcdir}/include/c_compatibility
e01c9849
BK
272c_compatibility_builddir = .
273c_compatibility_headers = \
274 ${c_compatibility_srcdir}/assert.h \
275 ${c_compatibility_srcdir}/ctype.h \
276 ${c_compatibility_srcdir}/errno.h \
277 ${c_compatibility_srcdir}/float.h \
278 ${c_compatibility_srcdir}/iso646.h \
279 ${c_compatibility_srcdir}/limits.h \
280 ${c_compatibility_srcdir}/locale.h \
281 ${c_compatibility_srcdir}/math.h \
282 ${c_compatibility_srcdir}/setjmp.h \
283 ${c_compatibility_srcdir}/signal.h \
284 ${c_compatibility_srcdir}/stdarg.h \
285 ${c_compatibility_srcdir}/stddef.h \
286 ${c_compatibility_srcdir}/stdio.h \
287 ${c_compatibility_srcdir}/stdlib.h \
288 ${c_compatibility_srcdir}/string.h \
289 ${c_compatibility_srcdir}/time.h \
290 ${c_compatibility_srcdir}/wchar.h \
82ba99d5 291 ${c_compatibility_srcdir}/wctype.h
e01c9849 292
285b36d6
BK
293# Debug mode headers
294debug_srcdir = ${glibcxx_srcdir}/include/debug
295debug_builddir = ./debug
296debug_headers = \
297 ${debug_srcdir}/bitset \
298 ${debug_srcdir}/debug.h \
299 ${debug_srcdir}/deque \
300 ${debug_srcdir}/formatter.h \
301 ${debug_srcdir}/hash_map \
302 ${debug_srcdir}/hash_map.h \
303 ${debug_srcdir}/hash_multimap.h \
304 ${debug_srcdir}/hash_multiset.h \
305 ${debug_srcdir}/hash_set \
306 ${debug_srcdir}/hash_set.h \
307 ${debug_srcdir}/list \
308 ${debug_srcdir}/map \
309 ${debug_srcdir}/map.h \
310 ${debug_srcdir}/multimap.h \
311 ${debug_srcdir}/multiset.h \
312 ${debug_srcdir}/safe_base.h \
313 ${debug_srcdir}/safe_iterator.h \
314 ${debug_srcdir}/safe_iterator.tcc \
315 ${debug_srcdir}/safe_sequence.h \
316 ${debug_srcdir}/set \
317 ${debug_srcdir}/set.h \
318 ${debug_srcdir}/string \
319 ${debug_srcdir}/vector
320
34ff0b99 321# Some of the different "C" header models need extra files.
e01c9849 322# Some "C" header schemes require the "C" compatibility headers.
34ff0b99 323# For --enable-cheaders=c_std
3d7c150e 324if GLIBCXX_C_HEADERS_C_STD
82ba99d5 325c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
34ff0b99 326else
82ba99d5 327c_base_headers_extra =
34ff0b99
BK
328endif
329
3d7c150e 330if GLIBCXX_C_HEADERS_COMPATIBILITY
e01c9849
BK
331c_compatibility_headers_extra = ${c_compatibility_headers}
332else
82ba99d5 333c_compatibility_headers_extra =
e01c9849
BK
334endif
335
ca618b60 336host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
a30335e9
BK
337host_builddir = ./${host_alias}/bits
338host_headers = \
339 ${host_srcdir}/ctype_base.h \
340 ${host_srcdir}/ctype_inline.h \
341 ${host_srcdir}/ctype_noninline.h \
342 ${host_srcdir}/os_defines.h \
2c5d0ae8 343 ${glibcxx_srcdir}/$(ATOMIC_WORD_SRCDIR)/atomic_word.h
6aa43d99 344
a30335e9
BK
345# Non-installed host_header files.
346host_headers_noinst = \
ca618b60 347 ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H)
6aa43d99 348
a30335e9
BK
349# These host_headers_extra files are all built with ad hoc naming rules.
350host_headers_extra = \
351 ${host_builddir}/basic_file.h \
352 ${host_builddir}/c++config.h \
353 ${host_builddir}/c++io.h \
354 ${host_builddir}/c++locale.h \
355 ${host_builddir}/messages_members.h \
356 ${host_builddir}/time_members.h \
357 ${host_builddir}/codecvt_specializations.h
358
359thread_host_headers = \
360 ${host_builddir}/gthr.h \
361 ${host_builddir}/gthr-single.h \
362 ${host_builddir}/gthr-posix.h \
363 ${host_builddir}/gthr-default.h
364
365pch_input = ${host_builddir}/stdc++.h
366pch_output_builddir = ${host_builddir}/stdc++.h.gch
3d7c150e 367pch_source = ${glibcxx_srcdir}/include/stdc++.h
9e57d5ca 368PCHFLAGS=-Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
3d7c150e 369if GLIBCXX_BUILD_PCH
8520f704 370pch_build = ${pch_input}
9e57d5ca
BK
371pch_install = install-pch
372else
82ba99d5
PE
373pch_build =
374pch_install =
9e57d5ca 375endif
628c731a 376
4a9d5109
SW
377# List of all timestamp files. By keeping only one copy of this list, both
378# CLEANFILES and all-local are kept up-to-date.
9e57d5ca 379allstamped = \
e01c9849 380 stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
285b36d6 381 stamp-backward stamp-ext stamp-debug stamp-host
9e57d5ca
BK
382
383# List of all files that are created by explicit building, editing, or
384# catenation.
385allcreated = \
a30335e9
BK
386 ${host_builddir}/c++config.h \
387 ${thread_host_headers} \
9e57d5ca 388 ${pch_build}
4a9d5109 389
4a9d5109 390# Here are the rules for building the headers
82ba99d5 391all-local: ${allstamped} ${allcreated}
4a9d5109 392
066930bb
PE
393# This rule is slightly different, in that we must change the name of the
394# local file from std_foo.h to foo.
4a9d5109
SW
395stamp-std: ${std_headers}
396 @if [ ! -d "${std_builddir}" ]; then \
397 mkdir -p ${std_builddir} ;\
398 fi ;\
7ec3af37
BK
399 if [ ! -f stamp-std ]; then \
400 (cd ${std_builddir} && for h in $?; do \
401 official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
82ba99d5 402 $(LN_S) $$h ./$${official_name} || true ;\
7ec3af37 403 done) ;\
82ba99d5
PE
404 fi ;\
405 $(STAMP) stamp-std
4a9d5109
SW
406
407stamp-bits: ${bits_headers}
408 @if [ ! -d "${bits_builddir}" ]; then \
409 mkdir -p ${bits_builddir} ;\
410 fi ;\
7ec3af37 411 if [ ! -f stamp-bits ]; then \
82ba99d5
PE
412 (cd ${bits_builddir} && $(LN_S) $? . || true) ;\
413 fi ;\
414 $(STAMP) stamp-bits
4a9d5109 415
82ba99d5 416stamp-c_base: stamp-bits ${c_base_headers} ${c_base_headers_extra}
4a9d5109
SW
417 @if [ ! -d "${c_base_builddir}" ]; then \
418 mkdir -p ${c_base_builddir} ;\
419 fi ;\
7ec3af37 420 if [ ! -f stamp-c_base ]; then \
9e57d5ca
BK
421 (cd ${c_base_builddir} && for h in ${c_base_headers}; do \
422 official_name=`echo $$h | sed -e 's,.*/std_,,' -e 's,\.h$$,,'` ;\
82ba99d5 423 $(LN_S) $$h ./$${official_name} || true ;\
9e57d5ca 424 done) ;\
7ec3af37 425 if [ ! -z "${c_base_headers_extra}" ]; then \
82ba99d5 426 (cd ${bits_builddir} && $(LN_S) ${c_base_headers_extra} . || true) ;\
7ec3af37 427 fi ;\
82ba99d5
PE
428 fi ;\
429 $(STAMP) stamp-c_base
4a9d5109 430
e01c9849
BK
431stamp-c_compatibility: ${c_compatibility_headers_extra}
432 @if [ ! -d "${c_compatibility_builddir}" ]; then \
433 mkdir -p ${c_compatibility_builddir} ;\
434 fi ;\
7ec3af37
BK
435 if [ ! -f stamp-c_compatibility ]; then \
436 if [ ! -z "${c_compatibility_headers_extra}" ]; then \
82ba99d5 437 (cd ${c_compatibility_builddir} && $(LN_S) $? . || true) ;\
7ec3af37 438 fi ;\
82ba99d5
PE
439 fi ;\
440 $(STAMP) stamp-c_compatibility
e01c9849 441
4a9d5109
SW
442stamp-backward: ${backward_headers}
443 @if [ ! -d "${backward_builddir}" ]; then \
444 mkdir -p ${backward_builddir} ;\
445 fi ;\
7ec3af37 446 if [ ! -f stamp-backward ]; then \
82ba99d5
PE
447 (cd ${backward_builddir} && $(LN_S) $? . || true) ;\
448 fi ;\
449 $(STAMP) stamp-backward
4a9d5109
SW
450
451stamp-ext: ${ext_headers}
452 @if [ ! -d "${ext_builddir}" ]; then \
7ec3af37 453 mkdir -p ${ext_builddir} ;\
4a9d5109 454 fi ;\
7ec3af37 455 if [ ! -f stamp-ext ]; then \
82ba99d5
PE
456 (cd ${ext_builddir} && $(LN_S) $? . || true) ;\
457 fi ;\
458 $(STAMP) stamp-ext
4a9d5109 459
285b36d6
BK
460stamp-debug: ${debug_headers}
461 @if [ ! -d "${debug_builddir}" ]; then \
462 mkdir -p ${debug_builddir} ;\
463 fi ;\
464 if [ ! -f stamp-debug ]; then \
465 (cd ${debug_builddir} && @LN_S@ $? . || true) ;\
466 fi ;\
467 $(STAMP) stamp-debug
468
a30335e9
BK
469stamp-${host_alias}:
470 @if [ ! -d ${host_builddir} ]; then \
471 mkdir -p ${host_builddir} ;\
82ba99d5
PE
472 fi ;\
473 $(STAMP) stamp-${host_alias}
843312be 474
a30335e9
BK
475# Host includes static.
476# XXX Missing dependency info for {host_headers_extra}
477stamp-host: ${host_headers} ${host_headers_noinst} stamp-${host_alias}
478 @if [ ! -f stamp-host ]; then \
479 (cd ${host_builddir} ;\
82ba99d5 480 $(LN_S) ${host_headers} . || true ;\
ca618b60
PE
481 $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_H) basic_file.h || true ;\
482 $(LN_S) ${glibcxx_srcdir}/$(CSTDIO_H) c++io.h || true ;\
483 $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_H) c++locale.h || true ;\
484 $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_INTERNAL_H) . || true ;\
485 $(LN_S) ${glibcxx_srcdir}/$(CMESSAGES_H) messages_members.h || true ;\
486 $(LN_S) ${glibcxx_srcdir}/$(CTIME_H) time_members.h || true ;\
487 $(LN_S) ${glibcxx_srcdir}/$(CCODECVT_H) codecvt_specializations.h || true);\
82ba99d5
PE
488 fi ;\
489 $(STAMP) stamp-host
4a9d5109 490
a30335e9 491# Host includes dynamic.
82ba99d5 492${host_builddir}/c++config.h: ${top_builddir}/config.h \
3d7c150e 493 ${glibcxx_srcdir}/include/bits/c++config \
a30335e9 494 stamp-${host_alias}
3d7c150e
BK
495 @cat ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
496 sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
497 -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
498 -e 's/VERSION/_GLIBCXX_VERSION/g' \
499 -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
42ebb17f 500 < ${CONFIG_HEADER} >> $@ ;\
3d7c150e 501 echo "#endif // _CXXCONFIG_" >>$@
4a9d5109 502
a30335e9 503# Host includes for threads
4a9d5109
SW
504uppercase = [ABCDEFGHIJKLMNOPQRSTUVWXYZ_]
505
a30335e9 506${host_builddir}/gthr.h: ${toplevel_srcdir}/gcc/gthr.h stamp-${host_alias}
3d7c150e 507 sed -e '/^#/s/\(${uppercase}${uppercase}*\)/_GLIBCXX_\1/g' \
ec2075e9 508 -e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
4a9d5109 509 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
533ab4d1 510 < ${toplevel_srcdir}/gcc/gthr.h > $@
4a9d5109 511
a30335e9
BK
512${host_builddir}/gthr-single.h: ${toplevel_srcdir}/gcc/gthr-single.h \
513 stamp-${host_alias}
3d7c150e
BK
514 sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
515 -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
533ab4d1 516 < ${toplevel_srcdir}/gcc/gthr-single.h > $@
4a9d5109 517
a30335e9
BK
518${host_builddir}/gthr-posix.h: ${toplevel_srcdir}/gcc/gthr-posix.h \
519 stamp-${host_alias}
3d7c150e
BK
520 sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
521 -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
ec2075e9
BK
522 -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
523 -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
79d6ba0b
LR
524 < ${toplevel_srcdir}/gcc/gthr-posix.h > $@
525
3d7c150e 526${host_builddir}/gthr-default.h: ${toplevel_srcdir}/gcc/${glibcxx_thread_h} \
a30335e9 527 stamp-${host_alias}
3d7c150e
BK
528 sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
529 -e 's/\(GCC${uppercase}*_H\)/_GLIBCXX_\1/g' \
ec2075e9
BK
530 -e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
531 -e 's/\(${uppercase}*USE_WEAK\)/_GLIBCXX_\1/g' \
79d6ba0b 532 -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
3d7c150e 533 < ${toplevel_srcdir}/gcc/${glibcxx_thread_h} > $@
4a9d5109 534
9e57d5ca 535# Build a precompiled C++ include, stdc++.h.gch.
a30335e9 536${pch_input}: ${allstamped} ${host_builddir}/c++config.h ${pch_source}
9e57d5ca 537 touch ${pch_input}; \
8520f704
LR
538 if [ ! -d "${pch_output_builddir}" ]; then \
539 mkdir -p ${pch_output_builddir}; \
540 fi; \
0df3f383
PE
541 $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g; \
542 $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g;
9e57d5ca 543
7bfea936
LR
544# For robustness sake (in light of junk files or in-source
545# configuration), copy from the build or source tree to the install
546# tree using only the human-maintained file lists and directory
547# components. Yes, with minor differences, this is sheer duplication
548# of the staging rules above using $(INSTALL_DATA) instead of LN_S and
3741b1ab 549# `$(mkinstalldirs)' instead of `mkdir -p'. In particular,
a30335e9 550# host_headers_extra are taken out of the build tree staging area;
7bfea936 551# the rest are taken from the original source tree.
9e57d5ca 552
92eabea2 553if GLIBCXX_HOSTED
9e57d5ca 554install-data-local: install-headers ${pch_install}
92eabea2
PE
555else
556install-data-local: install-freestanding-headers
557endif
9e57d5ca 558
92eabea2
PE
559# This is a subset of the full install-headers rule. We only need <cstddef>,
560# <limits>, <cstdlib>, <cstdarg>, <new>, <typeinfo>, <exception>, and any
561# files which they include (and which we provide). The last three headers
562# are installed by libsupc++, so only the first four and the sub-includes
563# are copied here.
564install-freestanding-headers:
565 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
566 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
567 for file in ${host_srcdir}/os_defines.h ${host_builddir}/c++config.h; do \
568 $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
569 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
570 $(INSTALL_DATA) ${std_builddir}/limits $(DESTDIR)${gxx_include_dir}/${std_builddir}
571 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
572 for file in cstddef cstdlib cstdarg; do \
573 $(INSTALL_DATA) ${c_base_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
574
575# The real deal.
9e57d5ca 576install-headers:
90e5b39f
CC
577 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}
578 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${bits_builddir}
7bfea936 579 for file in ${bits_headers}; do \
90e5b39f
CC
580 $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${bits_builddir}; done
581 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${backward_builddir}
7bfea936 582 for file in ${backward_headers}; do \
90e5b39f
CC
583 $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${backward_builddir}; done
584 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${ext_builddir}
7bfea936 585 for file in ${ext_headers}; do \
90e5b39f
CC
586 $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${ext_builddir}; done
587 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${c_base_builddir}
73249e33 588 for file in ${c_base_headers_rename}; do \
90e5b39f 589 $(INSTALL_DATA) ${c_base_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${c_base_builddir}; done
e01c9849 590 c_base_headers_extra_install='$(c_base_headers_extra)';\
3eb35fcf 591 for file in $$c_base_headers_extra_install; do \
90e5b39f 592 $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${bits_builddir}; done
e01c9849
BK
593 c_compatibility_headers_install='$(c_compatibility_headers_extra)';\
594 for file in $$c_compatibility_headers_install; do \
90e5b39f
CC
595 $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}; done
596 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
73249e33 597 for file in ${std_headers_rename}; do \
90e5b39f 598 $(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
285b36d6
BK
599 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
600 for file in ${debug_headers}; do \
601 $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
a30335e9
BK
602 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
603 for file in ${host_headers} ${host_headers_extra} \
604 ${thread_host_headers}; do \
605 $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${host_builddir}; done
4a9d5109 606
9e57d5ca 607install-pch:
8520f704
LR
608 $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}
609 for file in ${pch_output_builddir}/*; do \
610 $(INSTALL_DATA) $$file $(DESTDIR)${gxx_include_dir}/${pch_output_builddir}; done
9e57d5ca 611
4e10943d 612# By adding these files here, automake will remove them for 'make clean'
53c2acdf 613CLEANFILES = ${pch_input} ${pch_output_builddir}/*
c5535768
BK
614
615# Stop implicit '.o' make rules from ever stomping on extensionless
616# headers, in the improbable case where some foolish, crack-addled
617# developer tries to create them via make in the include build
618# directory. (This is more of an example of how this kind of rule can
619# be made.)
620.PRECIOUS: $(std_headers_rename) $(c_base_headers_rename)
621$(std_headers_rename): ; @:
622$(c_base_headers_rename): ; @: