Create startup files from the GCC sources and drop our versions.
[dragonfly.git] / gnu / lib / gcc40 / libstdc++ / Makefile
1 # $DragonFly: src/gnu/lib/gcc40/libstdc++/Attic/Makefile,v 1.2 2005/09/11 13:09:09 corecode Exp $
2
3 .include "../Makefile.inc"
4
5 .if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386'
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=    8
22
23 CFLAGS+=        -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
24 CFLAGS+=        -I${.CURDIR} -I${SUPDIR} -I${GCCDIR}/gcc -I${GCCDIR}/include
25 CXXFLAGS+=      -I${SRCDIR}/config/cpu/${MARCHDIR}
26 CXXFLAGS+=      -fno-implicit-templates -ffunction-sections -fdata-sections \
27                 -Wno-deprecated
28
29 LDADD=          -lm
30 DPADD+=         ${LIBM}
31
32 GCC_NO_LIBERTY= #
33
34 # libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
35 SRCS+=  bitmap_allocator.cc pool_allocator.cc mt_allocator.cc \
36         codecvt.cc compatibility.cc complex_io.cc ctype.cc debug.cc debug_list.cc \
37         functexcept.cc globals_locale.cc globals_io.cc ios.cc ios_failure.cc \
38         ios_init.cc ios_locale.cc limits.cc list.cc locale.cc locale_init.cc \
39         locale_facets.cc localename.cc stdexcept.cc strstream-fixed.cc tree.cc \
40         allocator-inst.cc concept-inst.cc fstream-inst.cc ext-inst.cc \
41         io-inst.cc istream-inst.cc istream.cc locale-inst.cc \
42         locale-misc-inst.cc misc-inst.cc ostream-inst.cc sstream-inst.cc \
43         streambuf-inst.cc streambuf.cc string-inst.cc valarray-inst.cc \
44         wlocale-inst.cc wstring-inst.cc
45
46 # target sources
47 SRCS+=  codecvt_members.cc collate_members.cc ctype_members.cc \
48         messages_members.cc monetary_members.cc numeric_members.cc \
49         time_members.cc 
50
51 SRCS+=  basic_file_stdio.cc c_locale.cc
52
53 SRCS+=  ctype_noninline.h ctype_base.h os_defines.h
54
55 atomicity.cc:
56         echo '#include "atomicity.h"' > ${.TARGET}
57
58 SRCS+=          atomicity.cc
59 CLEANFILES+=    atomicity.cc
60
61 # C parts of math
62 SRCS+=  signbit.c signbitf.c stubs.c
63
64 # Embedded copy of libsupc++
65 SRCS+=  del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc
66 SRCS+=  eh_alloc.cc eh_aux_runtime.cc eh_catch.cc eh_exception.cc
67 SRCS+=  eh_globals.cc eh_personality.cc eh_term_handler.cc eh_terminate.cc
68 SRCS+=  eh_throw.cc eh_type.cc eh_unex_handler.cc guard.cc new_handler.cc
69 SRCS+=  new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc
70 SRCS+=  tinfo2.cc vec.cc vterminate.cc
71
72 # from libiberty:
73 SRCS+=  cp-demangle.c
74
75 strstream-fixed.cc:     ${SRCDIR}/src/strstream.cc
76         sed -e 's,^#include <strstream>,#include <backward/strstream>,g' \
77             < ${SRCDIR}/src/strstream.cc > strstream-fixed.cc
78
79 CLEANFILES+=    strstream-fixed.cc
80
81 INCSGROUPS=     BITSHDRS BKWHDRS DEBUGHDRS EXTHDRS TR1HDRS \
82                 BASEHDRS BASEXHDRS STDHDRS TARGETHDRS THRHDRS
83
84 BITSHDRS= allocator.h atomicity.h basic_ios.h basic_ios.tcc \
85         basic_string.h basic_string.tcc boost_concept_check.h \
86         char_traits.h codecvt.h concept_check.h concurrence.h \
87         cpp_type_traits.h deque.tcc fstream.tcc functexcept.h \
88         gslice.h gslice_array.h indirect_array.h ios_base.h \
89         istream.tcc list.tcc locale_classes.h locale_facets.h \
90         locale_facets.tcc localefwd.h mask_array.h ostream.tcc \
91         postypes.h stream_iterator.h streambuf_iterator.h \
92         slice_array.h sstream.tcc stl_algo.h stl_algobase.h \
93         stl_bvector.h stl_construct.h stl_deque.h stl_function.h \
94         stl_heap.h stl_iterator.h stl_iterator_base_funcs.h \
95         stl_iterator_base_types.h stl_list.h stl_map.h \
96         stl_multimap.h stl_multiset.h stl_numeric.h stl_pair.h \
97         stl_queue.h stl_raw_storage_iter.h stl_relops.h stl_set.h \
98         stl_stack.h stl_tempbuf.h stl_tree.h stl_uninitialized.h \
99         stl_vector.h streambuf.tcc stringfwd.h valarray_array.h \
100         valarray_array.tcc valarray_before.h valarray_after.h \
101         vector.tcc
102 BITSHDRS:=      ${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
103 BITSHDRSDIR=    ${INCLUDEDIR}/c++/4.0/bits
104
105
106 BKWHDRS= complex.h iomanip.h istream.h ostream.h stream.h streambuf.h \
107         algo.h algobase.h alloc.h bvector.h defalloc.h deque.h \
108         function.h hash_map.h hash_set.h hashtable.h heap.h \
109         iostream.h iterator.h list.h map.h multimap.h new.h \
110         multiset.h pair.h queue.h rope.h set.h slist.h stack.h \
111         tempbuf.h tree.h vector.h fstream.h strstream \
112         backward_warning.h
113 BKWHDRS:=       ${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
114 BKWHDRSDIR=     ${INCLUDEDIR}/c++/4.0/backward
115
116 DEBUGHDRS= bitset debug.h deque formatter.h hash_map hash_map.h \
117         hash_multimap.h hash_multiset.h hash_set hash_set.h list map \
118         map.h multimap.h multiset.h safe_base.h safe_iterator.h \
119         safe_iterator.tcc safe_sequence.h set set.h string vector
120 DEBUGHDRS:=     ${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;}
121 DEBUGHDRSDIR=   ${INCLUDEDIR}/c++/4.0/debug
122
123 EXTHDRS= algorithm array_allocator.h bitmap_allocator.h \
124         debug_allocator.h stdio_filebuf.h \
125         stdio_sync_filebuf.h functional hash_map hash_set iterator \
126         malloc_allocator.h memory mt_allocator.h new_allocator.h \
127         numeric pod_char_traits.h pool_allocator.h rb_tree rope \
128         ropeimpl.h slist hash_fun.h hashtable.h
129 EXTHDRS:=       ${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
130 EXTHDRSDIR=     ${INCLUDEDIR}/c++/4.0/ext
131
132 TR1HDRS= array bind_repeat.h bind_iterate.h boost_shared_ptr.h \
133         mu_iterate.h functional functional_iterate.h memory \
134         ref_fwd.h ref_wrap_iterate.h repeat.h tuple tuple_iterate.h \
135         utility type_traits type_traits_fwd.h hashtable \
136         unordered_set unordered_map
137 TR1HDRS:=       ${TR1HDRS:S;^;${SRCDIR}/include/tr1/;}
138 TR1HDRSDIR=     ${INCLUDEDIR}/c++/4.0/tr1
139
140 # This is the common subset of files that all three "C" header models use.
141 BASEHDRS= std_cassert.h std_cctype.h std_cerrno.h std_cfloat.h \
142         std_ciso646.h std_climits.h std_clocale.h std_cmath.h \
143         std_csetjmp.h std_csignal.h std_cstdarg.h std_cstddef.h \
144         std_cstdio.h std_cstdlib.h std_cstring.h std_ctime.h \
145         std_cwchar.h std_cwctype.h
146 .for h in ${BASEHDRS}
147 BASEHDRSNAME_$h=${h:R:S;^std_;;}
148 .endfor
149 BASEHDRS:=      ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
150 BASEHDRSDIR=    ${INCLUDEDIR}/c++/4.0
151
152 # Some of the different "C" header models need extra files.
153 BASEXHDRS=      ${SRCDIR}/include/c_std/cmath.tcc
154 BASEXHDRSDIR=   ${INCLUDEDIR}/c++/4.0/bits
155
156 STDHDRS= std_algorithm.h std_bitset.h std_complex.h std_deque.h \
157         std_fstream.h std_functional.h std_iomanip.h std_ios.h \
158         std_iosfwd.h std_iostream.h std_istream.h std_iterator.h \
159         std_limits.h std_list.h std_locale.h std_map.h std_memory.h \
160         std_numeric.h std_ostream.h std_queue.h std_set.h \
161         std_sstream.h std_stack.h std_stdexcept.h std_streambuf.h \
162         std_string.h std_utility.h std_valarray.h std_vector.h
163 .for h in ${STDHDRS}
164 STDHDRSNAME_$h=${h:R:S;^std_;;}
165 .endfor
166 STDHDRS:=       ${STDHDRS:S;^;${SRCDIR}/include/std/;}
167 STDHDRSDIR=     ${INCLUDEDIR}/c++/4.0
168
169 # c++locale <- c_locale.h
170 TARGETHDRS=     io/basic_file_stdio.h
171 TARGETHDRSNAME_basic_file_stdio.h=      basic_file.h
172 TARGETHDRS+=    allocator/new_allocator_base.h
173 TARGETHDRSNAME_new_allocator_base.h=    c++allocator.h
174 TARGETHDRS+=    io/c_io_stdio.h
175 TARGETHDRSNAME_c_io_stdio.h=            c++io.h
176 TARGETHDRS+=    locale/generic/c_locale.h locale/generic/c++locale_internal.h
177 TARGETHDRSNAME_c_locale.h=              c++locale.h
178 TARGETHDRS+=    locale/generic/messages_members.h
179 TARGETHDRS+=    locale/generic/time_members.h
180 TARGETHDRS+=    os/bsd/netbsd/ctype_inline.h
181 TARGETHDRS+=    os/bsd/netbsd/os_defines.h
182 TARGETHDRS:=    ${TARGETHDRS:S;^;${SRCDIR}/config/;} ctype_noninline.h \
183                 ctype_base.h os_defines.h
184 TARGETHDRS+=    ${.CURDIR}/c++config.h
185 TARGETHDRSDIR=  ${INCLUDEDIR}/c++/4.0/bits
186
187 MARCHHDRS=      atomic_word.h cxxabi_tweaks.h
188
189 .for h in ${MARCHHDRS}
190 .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
191 TARGETHDRS+=    ${SRCDIR}/config/cpu/${MARCHDIR}/${h}
192 .else
193 TARGETHDRS+=    ${SRCDIR}/config/cpu/generic/${h}
194 .endif
195 .endfor
196
197 THRHDRS=        gthr.h gthr-single.h gthr-posix.h gthr-tpf.h gthr-default.h
198 THRHDRSDIR=     ${INCLUDEDIR}/c++/4.0/bits
199
200 gthr.h: ${GCCDIR}/gcc/gthr.h
201         sed -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCPP_\1/g' \
202             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
203             < ${GCCDIR}/gcc/gthr.h > gthr.h
204
205 gthr-single.h: ${GCCDIR}/gcc/gthr-single.h
206         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
207             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
208             < ${GCCDIR}/gcc/gthr-single.h > gthr-single.h
209
210 gthr-posix.h: ${GCCDIR}/gcc/gthr-posix.h
211         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
212             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
213             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
214             < ${GCCDIR}/gcc/gthr-posix.h > gthr-posix.h
215
216 gthr-default.h: ${GCCDIR}/gcc/gthr-posix.h
217         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
218             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
219             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
220             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
221             < ${GCCDIR}/gcc/gthr-posix.h > gthr-default.h
222
223 ctype_base.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h ctype_base.h.patch
224         patch -o ${.TARGET} -i ${.CURDIR}/ctype_base.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h
225
226 ctype_noninline.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h ctype_noninline.h.patch
227         patch -o ${.TARGET} -i ${.CURDIR}/ctype_noninline.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h
228
229 os_defines.h: ${SRCDIR}/config/os/bsd/netbsd/os_defines.h os_defines.h.patch
230         patch -o ${.TARGET} -i ${.CURDIR}/os_defines.h.patch ${SRCDIR}/config/os/bsd/netbsd/os_defines.h
231
232 CLEANFILES+=    ${THRHDRS} ctype_noninline.h ctype_base.h os_defines.h
233
234 .include <bsd.lib.mk>