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