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