Add C++ runtime libraries for gcc3
[dragonfly.git] / gnu / lib / gcc3 / libstdc++ / Makefile
1 # $FreeBSD: src/gnu/lib/libstdc++/Makefile,v 1.49 2004/01/06 19:20:30 kan Exp $
2 # $DragonFly: src/gnu/lib/gcc3/libstdc++/Attic/Makefile,v 1.1 2004/01/22 21:45:57 joerg Exp $
3
4 GCCDIR= ${.CURDIR}/../../../../contrib/gcc3
5 SRCDIR= ${.CURDIR}/../../../../contrib/libstdc++3
6 SUPDIR= ${SRCDIR}/libsupc++
7
8 .PATH: ${SRCDIR}/src ${SRCDIR}/libmath ${SRCDIR}/config/io \
9        ${SRCDIR}/config/locale/generic ${SRCDIR} ${SRCDIR}/std \
10        ${SUPDIR} ${GCCDIR}
11
12 #SUBDIR=        doc
13
14 LIB=            stdc++
15 SHLIB_MAJOR=    4
16
17 CFLAGS+=        -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
18 CFLAGS+=        -I${.CURDIR} -I${SUPDIR} -I${GCCDIR}
19 CXXFLAGS+=      -fno-implicit-templates -ffunction-sections -fdata-sections \
20                 -Wno-deprecated
21 #LDFLAGS+=      -Wl,-version-info,4:0:0 -Wl,--version-script=${SRCDIR}/src/linker.map
22
23 LDADD+=         -lm
24 DPADD+=         ${LIBM}
25
26 # libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
27 SRCS+= bitset.cc codecvt.cc complex_io.cc concept-inst.cc ctype.cc \
28         ext-inst.cc fstream.cc fstream-inst.cc functexcept.cc \
29         globals.cc io-inst.cc ios.cc istream-inst.cc limits.cc \
30         locale.cc locale-inst.cc localename.cc misc-inst.cc \
31         ostream-inst.cc  sstream-inst.cc stdexcept.cc stl-inst.cc \
32         streambuf-inst.cc string-inst.cc strstream-fixed.cc \
33         valarray-inst.cc vterminate.cc wstring-inst.cc
34
35 # target sources
36 SRCS+=  codecvt_members.cc collate_members.cc ctype_members.cc \
37         messages_members.cc monetary_members.cc numeric_members.cc \
38         time_members.cc
39
40 # target sources extra
41 SRCS+=  basic_file_stdio.cc c_locale.cc
42
43 # C parts of math
44 SRCS+=  nan.c signbit.c signbitf.c signbitl.c stubs.c
45
46 # Embedded copy of libsupc++
47 SRCS+=  del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc \
48         eh_alloc.cc eh_aux_runtime.cc eh_catch.cc eh_exception.cc \
49         eh_globals.cc eh_personality.cc eh_terminate.cc eh_throw.cc eh_type.cc \
50         guard.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc \
51         pure.cc tinfo.cc tinfo2.cc vec.cc
52
53 # from libiberty:
54 SRCS+=  cp-demangle.c dyn-string.c
55
56 strstream-fixed.cc:     ${SRCDIR}/src/strstream.cc
57         sed -e 's,^#include <strstream>,#include <backward/strstream>,g' \
58             < ${SRCDIR}/src/strstream.cc > strstream-fixed.cc
59
60 CLEANFILES+=    strstream-fixed.cc
61
62 INCSGROUPS=     BITSHDRS BKWHDRS EXTHDRS BASEHDRS BASEXHDRS STDHDRS \
63                 TARGETHDRS THRHDRS
64
65 BITSHDRS=       basic_ios.h basic_ios.tcc basic_string.h basic_string.tcc \
66                 boost_concept_check.h char_traits.h codecvt.h concept_check.h \
67                 cpp_type_traits.h deque.tcc fpos.h fstream.tcc functexcept.h \
68                 gslice.h gslice_array.h indirect_array.h \
69                 ios_base.h istream.tcc list.tcc \
70                 locale_classes.h locale_facets.h locale_facets.tcc \
71                 localefwd.h mask_array.h ostream.tcc pthread_allocimpl.h \
72                 slice_array.h sstream.tcc stl_algo.h stl_algobase.h \
73                 stl_alloc.h stl_bvector.h stl_construct.h stl_deque.h \
74                 stl_function.h stl_heap.h stl_iterator.h \
75                 stl_iterator_base_funcs.h stl_iterator_base_types.h \
76                 stl_list.h stl_map.h stl_multimap.h stl_multiset.h \
77                 stl_numeric.h stl_pair.h stl_pthread_alloc.h stl_queue.h \
78                 stl_raw_storage_iter.h stl_relops.h stl_set.h stl_stack.h \
79                 stl_tempbuf.h stl_threads.h stl_tree.h stl_uninitialized.h \
80                 stl_vector.h stream_iterator.h streambuf.tcc \
81                 streambuf_iterator.h stringfwd.h type_traits.h \
82                 valarray_array.h valarray_array.tcc valarray_meta.h \
83                 vector.tcc
84 BITSHDRS:=      ${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
85 BITSHDRSDIR=    ${INCLUDEDIR}/c++/3.3/bits
86
87 BKWHDRS=        algo.h algobase.h alloc.h backward_warning.h bvector.h \
88                 complex.h defalloc.h deque.h fstream.h function.h \
89                 hash_map.h hash_set.h hashtable.h heap.h iomanip.h \
90                 iostream.h istream.h iterator.h list.h map.h multimap.h \
91                 multiset.h new.h ostream.h pair.h queue.h rope.h set.h \
92                 slist.h stack.h stream.h streambuf.h strstream \
93                 tempbuf.h tree.h vector.h
94 BKWHDRS:=       ${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
95 BKWHDRSDIR=     ${INCLUDEDIR}/c++/3.3/backward
96
97 EXTHDRS=        algorithm enc_filebuf.h functional hash_map hash_set \
98                 iterator memory numeric rb_tree rope ropeimpl.h slist \
99                 stdio_filebuf.h stl_hash_fun.h stl_hashtable.h stl_rope.h
100 EXTHDRS:=       ${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
101 EXTHDRSDIR=     ${INCLUDEDIR}/c++/3.3/ext
102
103 # This is the common subset of files that all three "C" header models use.
104 BASEHDRS=       std_cassert.h std_cctype.h std_cerrno.h std_cfloat.h \
105                 std_ciso646.h std_climits.h std_clocale.h std_cmath.h \
106                 std_csetjmp.h std_csignal.h std_cstdarg.h std_cstddef.h \
107                 std_cstdio.h std_cstdlib.h std_cstring.h std_ctime.h \
108                 std_cwchar.h std_cwctype.h
109 .for h in ${BASEHDRS}
110 BASEHDRSNAME_$h=${h:R:S;^std_;;}
111 .endfor
112 BASEHDRS:=      ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
113 BASEHDRSDIR=    ${INCLUDEDIR}/c++/3.3
114
115 # Some of the different "C" header models need extra files.
116 BASEXHDRS=      ${SRCDIR}/include/c_std/cmath.tcc
117 BASEXHDRSDIR=   ${INCLUDEDIR}/c++/3.3/bits
118
119 STDHDRS=        std_algorithm.h std_bitset.h std_complex.h std_deque.h \
120                 std_fstream.h std_functional.h std_iomanip.h std_ios.h \
121                 std_iosfwd.h std_iostream.h std_istream.h std_iterator.h \
122                 std_limits.h std_list.h std_locale.h std_map.h std_memory.h \
123                 std_numeric.h std_ostream.h std_queue.h std_set.h \
124                 std_sstream.h std_stack.h std_stdexcept.h std_streambuf.h \
125                 std_string.h std_utility.h std_valarray.h std_vector.h
126 .for h in ${STDHDRS}
127 STDHDRSNAME_$h=${h:R:S;^std_;;}
128 .endfor
129 STDHDRS:=       ${STDHDRS:S;^;${SRCDIR}/include/std/;}
130 STDHDRSDIR=     ${INCLUDEDIR}/c++/3.3
131
132 TARGETHDRS=     io/basic_file_stdio.h io/c_io_stdio.h \
133                 locale/generic/c_locale.h \
134                 locale/generic/c++locale_internal.h \
135                 locale/generic/codecvt_specializations.h \
136                 locale/generic/messages_members.h \
137                 locale/generic/time_members.h \
138                 os/bsd/freebsd/ctype_base.h \
139                 os/bsd/freebsd/ctype_inline.h \
140                 os/bsd/freebsd/ctype_noninline.h \
141                 os/bsd/freebsd/os_defines.h
142 TARGETHDRS:=    ${TARGETHDRS:S;^;${SRCDIR}/config/;}
143 TARGETHDRS+=    ${.CURDIR}/c++config.h
144 TARGETHDRSNAME_basic_file_stdio.h= basic_file.h
145 TARGETHDRSNAME_c_io_stdio.h= c++io.h
146 TARGETHDRSNAME_c_locale.h= c++locale.h
147 TARGETHDRSDIR=  ${INCLUDEDIR}/c++/3.3/bits
148
149 MARCHHDRS=      atomicity.h
150 .if ${MACHINE_ARCH} == "sparc64"
151 MARCHDIR=       sparc
152 .elif ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386'
153 MARCHDIR=       i486
154 .else
155 MARCHDIR=       ${MACHINE_ARCH}
156 .endif
157
158 .for h in ${MARCHHDRS}
159 .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
160 TARGETHDRS+=    ${SRCDIR}/config/cpu/${MARCHDIR}/${h}
161 .else
162 TARGETHDRS+=    ${SRCDIR}/config/cpu/generic/${h}
163 .endif
164 .endfor
165
166 THRHDRS=        gthr.h gthr-single.h gthr-posix.h gthr-default.h
167 THRHDRSDIR=     ${INCLUDEDIR}/c++/3.3/bits
168
169 gthr.h: ${GCCDIR}/gthr.h
170         sed -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCPP_\1/g' \
171             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
172             < ${GCCDIR}/gthr.h > gthr.h
173
174 gthr-single.h: ${GCCDIR}/gthr-single.h
175         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
176             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
177             < ${GCCDIR}/gthr-single.h > gthr-single.h
178
179 gthr-posix.h: ${GCCDIR}/gthr-posix.h
180         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
181             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
182             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
183             < ${GCCDIR}/gthr-posix.h > gthr-posix.h
184
185 gthr-default.h: ${GCCDIR}/gthr-posix.h
186         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
187             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
188             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
189             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
190             < ${GCCDIR}/gthr-posix.h > gthr-default.h
191
192 CLEANFILES+=    ${THRHDRS}
193
194 .include <bsd.lib.mk>