54162077536513b16467d34a7a56c5696e313577
[dragonfly.git] / gnu / lib / gcc41 / libstdc++ / Makefile
1 # $DragonFly: src/gnu/lib/gcc41/libstdc++/Makefile,v 1.3 2007/01/20 18:24:34 corecode Exp $
2
3 .include "../Makefile.inc"
4
5 .if ${MACHINE_ARCH} == "i386" && !empty(MACHINE_CPU:Mi486)
6 MARCHDIR=       i486
7 .else
8 MARCHDIR=       ${MACHINE_ARCH}
9 .endif
10
11 SRCDIR= ${GCCDIR}/libstdc++-v3
12 SUPDIR= ${SRCDIR}/libsupc++
13
14 .PATH:  ${SRCDIR}/src ${SRCDIR}/libmath ${SRCDIR}/config/io
15 .PATH:  ${SRCDIR}/config/locale/generic ${SRCDIR}
16 .PATH:  ${SUPDIR} ${GCCDIR}/gcc ${GCCDIR}/libiberty
17
18 #SUBDIR=        doc
19
20 LIB=            stdc++
21 SHLIB_MAJOR=    9
22
23 CFLAGS+=        -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
24 CFLAGS+=        -I. -I${.CURDIR}
25 CFLAGS+=        -I${SUPDIR} -I${GCCDIR}/gcc -I${GCCDIR}/include
26 CXXFLAGS+=      -I${SRCDIR}/config/cpu/${MARCHDIR}
27 CXXFLAGS+=      -fno-implicit-templates -ffunction-sections -fdata-sections \
28                 -Wno-deprecated
29
30 LDADD+=         -lm
31 DPADD+=         ${LIBM}
32
33 # libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
34 SRCS+=  \
35         bitmap_allocator.cc \
36         pool_allocator.cc \
37         mt_allocator.cc \
38         codecvt.cc \
39         compatibility.cc \
40         complex_io.cc \
41         ctype.cc \
42         debug.cc \
43         debug_list.cc \
44         functexcept.cc \
45         globals_locale.cc \
46         globals_io.cc \
47         ios.cc \
48         ios_failure.cc \
49         ios_init.cc \
50         ios_locale.cc \
51         limits.cc \
52         list.cc \
53         locale.cc \
54         locale_init.cc \
55         locale_facets.cc \
56         localename.cc \
57         stdexcept.cc \
58         strstream.cc \
59         tree.cc \
60         allocator-inst.cc \
61         concept-inst.cc \
62         fstream-inst.cc \
63         ext-inst.cc \
64         ios-inst.cc \
65         iostream-inst.cc \
66         istream-inst.cc \
67         istream.cc \
68         locale-inst.cc \
69         locale-misc-inst.cc \
70         misc-inst.cc \
71         ostream-inst.cc \
72         sstream-inst.cc \
73         streambuf-inst.cc \
74         streambuf.cc \
75         string-inst.cc \
76         valarray-inst.cc \
77         wlocale-inst.cc \
78         wstring-inst.cc \
79         ${host_sources} \
80         ${host_sources_extra}
81
82 host_sources = \
83         atomicity.cc \
84         codecvt_members.cc \
85         collate_members.cc \
86         ctype_members.cc \
87         messages_members.cc \
88         monetary_members.cc \
89         numeric_members.cc \
90         time_members.cc 
91
92 host_sources_extra = \
93         basic_file_stdio.cc \
94         c_locale.cc
95
96 SRCS+=  ctype_noninline.h ctype_base.h
97
98 atomicity.cc:
99         echo '#include "atomicity.h"' > ${.TARGET}
100
101 CLEANFILES+=    atomicity.cc
102
103 # C parts of math
104 SRCS+=  stubs.c
105
106 # Embedded copy of libsupc++
107 SRCS+=  \
108         del_op.cc \
109         del_opnt.cc \
110         del_opv.cc \
111         del_opvnt.cc \
112         eh_alloc.cc \
113         eh_arm.cc \
114         eh_aux_runtime.cc \
115         eh_call.cc \
116         eh_catch.cc \
117         eh_exception.cc \
118         eh_globals.cc \
119         eh_personality.cc \
120         eh_term_handler.cc \
121         eh_terminate.cc \
122         eh_throw.cc \
123         eh_type.cc \
124         eh_unex_handler.cc \
125         guard.cc \
126         new_handler.cc \
127         new_op.cc \
128         new_opnt.cc \
129         new_opv.cc \
130         new_opvnt.cc \
131         pure.cc \
132         tinfo.cc \
133         tinfo2.cc \
134         vec.cc \
135         vterminate.cc
136
137 # from libiberty
138 SRCS+=  cp-demangle.c
139
140 SRCS+=  unwind.h
141
142 unwind.h: unwind-generic.h
143         cp ${.ALLSRC} ${.TARGET}
144
145 CLEANFILES+=    unwind.h
146
147
148 strstream.cc:   ${SRCDIR}/src/strstream.cc
149         sed -e 's,^#include <strstream>,#include <backward/strstream>,g' \
150             < ${.ALLSRC} > ${.TARGET}
151
152 CLEANFILES+=    strstream.cc
153
154
155 INCSGROUPS=     BITSHDRS BKWHDRS DEBUGHDRS EXTHDRS TR1HDRS \
156                 BASEHDRS BASEXHDRS STDHDRS TARGETHDRS THRHDRS
157
158 STDHDRS=        \
159         std_algorithm.h \
160         std_bitset.h \
161         std_complex.h \
162         std_deque.h \
163         std_fstream.h \
164         std_functional.h \
165         std_iomanip.h \
166         std_ios.h \
167         std_iosfwd.h \
168         std_iostream.h \
169         std_istream.h \
170         std_iterator.h \
171         std_limits.h \
172         std_list.h \
173         std_locale.h \
174         std_map.h \
175         std_memory.h \
176         std_numeric.h \
177         std_ostream.h \
178         std_queue.h \
179         std_set.h \
180         std_sstream.h \
181         std_stack.h \
182         std_stdexcept.h \
183         std_streambuf.h \
184         std_string.h \
185         std_utility.h \
186         std_valarray.h \
187         std_vector.h
188 .for h in ${STDHDRS}
189 STDHDRSNAME_$h=${h:R:S;^std_;;}
190 .endfor
191 STDHDRS:=       ${STDHDRS:S;^;${SRCDIR}/include/std/;}
192 STDHDRSDIR=     ${INCLUDEDIR}/c++/4.1
193
194
195 BITSHDRS=       \
196         allocator.h \
197         atomicity.h \
198         basic_ios.h \
199         basic_ios.tcc \
200         basic_string.h \
201         basic_string.tcc \
202         boost_concept_check.h \
203         char_traits.h \
204         codecvt.h \
205         concept_check.h \
206         concurrence.h \
207         cpp_type_traits.h \
208         deque.tcc \
209         fstream.tcc \
210         functexcept.h \
211         gslice.h \
212         gslice_array.h \
213         indirect_array.h \
214         ios_base.h \
215         istream.tcc \
216         list.tcc \
217         locale_classes.h \
218         locale_facets.h \
219         locale_facets.tcc \
220         localefwd.h \
221         mask_array.h \
222         ostream.tcc \
223         postypes.h \
224         stream_iterator.h \
225         streambuf_iterator.h \
226         slice_array.h \
227         sstream.tcc \
228         stl_algo.h \
229         stl_algobase.h \
230         stl_bvector.h \
231         stl_construct.h \
232         stl_deque.h \
233         stl_function.h \
234         stl_heap.h \
235         stl_iterator.h \
236         stl_iterator_base_funcs.h \
237         stl_iterator_base_types.h \
238         stl_list.h \
239         stl_map.h \
240         stl_multimap.h \
241         stl_multiset.h \
242         stl_numeric.h \
243         stl_pair.h \
244         stl_queue.h \
245         stl_raw_storage_iter.h \
246         stl_relops.h \
247         stl_set.h \
248         stl_stack.h \
249         stl_tempbuf.h \
250         stl_tree.h \
251         stl_uninitialized.h \
252         stl_vector.h \
253         streambuf.tcc \
254         stringfwd.h \
255         valarray_array.h \
256         valarray_array.tcc \
257         valarray_before.h \
258         valarray_after.h \
259         vector.tcc
260 BITSHDRS:=      ${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
261 BITSHDRSDIR=    ${INCLUDEDIR}/c++/4.1/bits
262
263
264 BKWHDRS=        \
265         complex.h \
266         iomanip.h \
267         istream.h \
268         ostream.h \
269         stream.h \
270         streambuf.h \
271         algo.h \
272         algobase.h \
273         alloc.h \
274         bvector.h \
275         defalloc.h \
276         deque.h \
277         function.h \
278         hash_map.h \
279         hash_set.h \
280         hashtable.h \
281         heap.h \
282         iostream.h \
283         iterator.h \
284         list.h \
285         map.h \
286         multimap.h \
287         new.h \
288         multiset.h \
289         pair.h \
290         queue.h \
291         rope.h \
292         set.h \
293         slist.h \
294         stack.h \
295         tempbuf.h \
296         tree.h \
297         vector.h \
298         fstream.h \
299         strstream \
300         backward_warning.h
301 BKWHDRS:=       ${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
302 BKWHDRSDIR=     ${INCLUDEDIR}/c++/4.1/backward
303
304
305 EXTHDRS=        \
306         algorithm \
307         array_allocator.h \
308         bitmap_allocator.h \
309         codecvt_specializations.h \
310         debug_allocator.h \
311         stdio_filebuf.h \
312         stdio_sync_filebuf.h \
313         functional \
314         hash_map \
315         hash_set \
316         hash_fun.h \
317         hashtable.h \
318         iterator \
319         malloc_allocator.h \
320         memory \
321         mt_allocator.h \
322         new_allocator.h \
323         numeric \
324         pod_char_traits.h \
325         pool_allocator.h \
326         rb_tree \
327         rope \
328         ropeimpl.h \
329         slist \
330         typelist.h \
331         rc_string_base.h \
332         sso_string_base.h \
333         vstring.h \
334         vstring.tcc \
335         vstring_fwd.h \
336         vstring_util.h  
337 EXTHDRS:=       ${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
338 EXTHDRSDIR=     ${INCLUDEDIR}/c++/4.1/ext
339
340
341 TR1HDRS=        \
342         array \
343         bind_repeat.h \
344         bind_iterate.h \
345         boost_shared_ptr.h \
346         mu_iterate.h \
347         functional \
348         functional_iterate.h \
349         memory \
350         ref_fwd.h \
351         ref_wrap_iterate.h \
352         repeat.h \
353         tuple \
354         tuple_iterate.h \
355         utility \
356         type_traits \
357         type_traits_fwd.h \
358         hashtable \
359         unordered_set \
360         unordered_map
361 TR1HDRS:=       ${TR1HDRS:S;^;${SRCDIR}/include/tr1/;}
362 TR1HDRSDIR=     ${INCLUDEDIR}/c++/4.1/tr1
363
364
365 # This is the common subset of files that all three "C" header models use.
366 BASEHDRS=       \
367         std_cassert.h \
368         std_cctype.h \
369         std_cerrno.h \
370         std_cfloat.h \
371         std_ciso646.h \
372         std_climits.h \
373         std_clocale.h \
374         std_cmath.h \
375         std_csetjmp.h \
376         std_csignal.h \
377         std_cstdarg.h \
378         std_cstddef.h \
379         std_cstdio.h \
380         std_cstdlib.h \
381         std_cstring.h \
382         std_ctime.h \
383         std_cwchar.h \
384         std_cwctype.h
385 .for h in ${BASEHDRS}
386 BASEHDRSNAME_$h=${h:R:S;^std_;;}
387 .endfor
388 BASEHDRS:=      ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
389 BASEHDRSDIR=    ${INCLUDEDIR}/c++/4.1
390
391 # Some of the different "C" header models need extra files.
392 BASEXHDRS=      ${SRCDIR}/include/c_std/cmath.tcc
393 BASEXHDRSDIR=   ${INCLUDEDIR}/c++/4.1/bits
394
395
396 DEBUGHDRS=      \
397         bitset \
398         debug.h \
399         deque \
400         formatter.h \
401         functions.h \
402         hash_map \
403         hash_map.h \
404         hash_multimap.h \
405         hash_multiset.h \
406         hash_set \
407         hash_set.h \
408         list \
409         map \
410         macros.h \
411         map.h \
412         multimap.h \
413         multiset.h \
414         safe_base.h \
415         safe_iterator.h \
416         safe_iterator.tcc \
417         safe_sequence.h \
418         set \
419         set.h \
420         string \
421         vector
422 DEBUGHDRS:=     ${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;}
423 DEBUGHDRSDIR=   ${INCLUDEDIR}/c++/4.1/debug
424
425
426 # c++locale <- c_locale.h
427 TARGETHDRS=     io/basic_file_stdio.h
428 TARGETHDRSNAME_basic_file_stdio.h=      basic_file.h
429 TARGETHDRS+=    allocator/new_allocator_base.h
430 TARGETHDRSNAME_new_allocator_base.h=    c++allocator.h
431 TARGETHDRS+=    io/c_io_stdio.h
432 TARGETHDRSNAME_c_io_stdio.h=            c++io.h
433 TARGETHDRS+=    locale/generic/c_locale.h locale/generic/c++locale_internal.h
434 TARGETHDRSNAME_c_locale.h=              c++locale.h
435 TARGETHDRS+=    locale/generic/messages_members.h
436 TARGETHDRS+=    locale/generic/time_members.h
437 TARGETHDRS+=    os/bsd/netbsd/ctype_inline.h
438 TARGETHDRS:=    ${TARGETHDRS:S;^;${SRCDIR}/config/;}
439 TARGETHDRS+=    ctype_base.h ctype_noninline.h os_defines.h
440 TARGETHDRS+=    c++config.h
441 TARGETHDRSDIR=  ${INCLUDEDIR}/c++/4.1/bits
442
443 MARCHHDRS=      atomic_word.h cxxabi_tweaks.h cpu_defines.h
444
445 .for h in ${MARCHHDRS}
446 .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
447 TARGETHDRS+=    ${SRCDIR}/config/cpu/${MARCHDIR}/${h}
448 .else
449 TARGETHDRS+=    ${SRCDIR}/config/cpu/generic/${h}
450 .endif
451 .endfor
452
453 THRHDRS=        gthr.h gthr-single.h gthr-posix.h gthr-default.h
454 THRHDRSDIR=     ${INCLUDEDIR}/c++/4.1/bits
455
456 gthr.h: ${GCCDIR}/gcc/gthr.h
457         sed -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCPP_\1/g' \
458             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
459             < ${GCCDIR}/gcc/gthr.h > gthr.h
460
461 gthr-single.h: ${GCCDIR}/gcc/gthr-single.h
462         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
463             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
464             < ${GCCDIR}/gcc/gthr-single.h > gthr-single.h
465
466 gthr-posix.h: ${GCCDIR}/gcc/gthr-posix.h
467         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
468             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
469             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
470             < ${GCCDIR}/gcc/gthr-posix.h > gthr-posix.h
471
472 gthr-default.h: ${GCCDIR}/gcc/gthr-posix.h
473         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
474             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
475             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
476             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
477             < ${GCCDIR}/gcc/gthr-posix.h > gthr-default.h
478
479 ctype_base.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h ctype_base.h.patch
480         patch -o ${.TARGET} -i ${.CURDIR}/ctype_base.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h
481
482 ctype_noninline.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h ctype_noninline.h.patch
483         patch -o ${.TARGET} -i ${.CURDIR}/ctype_noninline.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h
484
485 c++config.h: config.h ${SRCDIR}/include/bits/c++config DATESTAMP
486         cat ${.ALLSRC:M*c++config} > ${.TARGET}
487         sed -e 's/^/#define __GLIBCXX__ /' < ${.ALLSRC:M*DATESTAMP} >> ${.TARGET}
488         sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
489             -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
490             -e 's/VERSION/_GLIBCXX_VERSION/g' \
491             -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
492             < ${.ALLSRC:M*config.h} >> ${.TARGET}
493         echo "#endif // _CXXCONFIG_" >> ${.TARGET}
494
495 CLEANFILES+=    ${THRHDRS} ctype_noninline.h ctype_base.h c++config.h
496
497 .include <bsd.lib.mk>