Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
[dragonfly.git] / gnu / lib / gcc34 / libstdc++ / Makefile
1 # $DragonFly: src/gnu/lib/gcc34/libstdc++/Makefile,v 1.8 2007/01/19 10:38:38 corecode Exp $
2
3 .include "../Makefile.inc"
4
5 .if ${MACHINE_ARCH} == "sparc64"
6 MARCHDIR=       sparc
7 .elif ${MACHINE_ARCH} == "i386" && !empty(MACHINE_CPU:Mi486)
8 MARCHDIR=       i486
9 .elif ${MACHINE_ARCH} == "amd64"
10 MARCHDIR=       i486
11 .else
12 MARCHDIR=       ${MACHINE_ARCH}
13 .endif
14
15 SRCDIR= ${GCCDIR}/libstdc++-v3
16 SUPDIR= ${SRCDIR}/libsupc++
17
18 .PATH:  ${SRCDIR}/src ${SRCDIR}/libmath ${SRCDIR}/config/io
19 .PATH:  ${SRCDIR}/config/locale/generic ${SRCDIR} ${SRCDIR}/std
20 .PATH:  ${SUPDIR} ${GCCDIR}/gcc ${GCCDIR}/libiberty
21
22 #SUBDIR=        doc
23
24 LIB=            stdc++
25 SHLIB_MAJOR=    7
26
27 CFLAGS+=        -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
28 CFLAGS+=        -I${.CURDIR} -I${SUPDIR} -I${GCCDIR}/gcc -I${GCCDIR}/include
29 CXXFLAGS+=      -I${SRCDIR}/config/cpu/${MARCHDIR}
30 CXXFLAGS+=      -fno-implicit-templates -ffunction-sections -fdata-sections \
31                 -Wno-deprecated
32 #LDFLAGS+=      -Wl,-version-info,4:0:0 -Wl,--version-script=${SRCDIR}/src/linker.map
33
34 LDADD+=         -lm
35 DPADD+=         ${LIBM}
36
37 # libstdc++ sources (libstdc++/src/Makefile.in, do not reorder)
38 SRCS+=  allocator.cc codecvt.cc complex_io.cc ctype.cc debug.cc debug_list.cc
39 SRCS+=  functexcept.cc globals_locale.cc globals_io.cc ios.cc ios_failure.cc
40 SRCS+=  ios_init.cc ios_locale.cc limits.cc list.cc locale.cc locale_init.cc
41 SRCS+=  locale_facets.cc localename.cc stdexcept.cc strstream.cc tree.cc
42 SRCS+=  allocator-inst.cc concept-inst.cc fstream-inst.cc ext-inst.cc
43 SRCS+=  io-inst.cc istream-inst.cc locale-inst.cc locale-misc-inst.cc
44 SRCS+=  misc-inst.cc ostream-inst.cc sstream-inst.cc streambuf-inst.cc
45 SRCS+=  string-inst.cc valarray-inst.cc wlocale-inst.cc wstring-inst.cc
46 SRCS+=  basic_file_stdio.cc c_locale.cc
47
48 # target sources
49 SRCS+=  codecvt_members.cc collate_members.cc ctype_members.cc
50 SRCS+=  messages_members.cc monetary_members.cc numeric_members.cc
51 SRCS+=  time_members.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 # dyn-string.c
75
76 strstream-fixed.cc:     ${SRCDIR}/src/strstream.cc
77         sed -e 's,^#include <strstream>,#include <backward/strstream>,g' \
78             < ${SRCDIR}/src/strstream.cc > strstream-fixed.cc
79
80 CLEANFILES+=    strstream-fixed.cc
81
82 INCSGROUPS=     BITSHDRS BKWHDRS DEBUGHDRS EXTHDRS BASEHDRS BASEXHDRS STDHDRS \
83                 TARGETHDRS THRHDRS
84
85 BITSHDRS=       allocator.h atomicity.h basic_ios.h basic_ios.tcc
86 BITSHDRS+=      basic_string.h basic_string.tcc boost_concept_check.h
87 BITSHDRS+=      char_traits.h codecvt.h concept_check.h
88 BITSHDRS+=      concurrence.h cpp_type_traits.h deque.tcc fstream.tcc
89 BITSHDRS+=      functexcept.h gslice.h gslice_array.h indirect_array.h
90 BITSHDRS+=      ios_base.h istream.tcc list.tcc locale_classes.h
91 BITSHDRS+=      locale_facets.h locale_facets.tcc localefwd.h mask_array.h
92 BITSHDRS+=      ostream.tcc postypes.h slice_array.h sstream.tcc stl_algo.h
93 BITSHDRS+=      stl_algobase.h stl_bvector.h stl_construct.h stl_deque.h
94 BITSHDRS+=      stl_function.h stl_heap.h stl_iterator.h
95 BITSHDRS+=      stl_iterator_base_funcs.h stl_iterator_base_types.h stl_list.h
96 BITSHDRS+=      stl_map.h stl_multimap.h stl_multiset.h stl_numeric.h
97 BITSHDRS+=      stl_pair.h stl_queue.h stl_raw_storage_iter.h stl_relops.h
98 BITSHDRS+=      stl_set.h stl_stack.h stl_tempbuf.h stl_threads.h stl_tree.h
99 BITSHDRS+=      stl_uninitialized.h stl_vector.h stream_iterator.h
100 BITSHDRS+=      streambuf.tcc streambuf_iterator.h stringfwd.h type_traits.h
101 BITSHDRS+=      valarray_after.h valarray_array.h valarray_array.tcc
102 BITSHDRS+=      valarray_before.h vector.tcc
103
104 BITSHDRS:=      ${BITSHDRS:S;^;${SRCDIR}/include/bits/;}
105 BITSHDRSDIR=    ${INCLUDEDIR}/c++/3.4/bits
106
107 BKWHDRS=        algo.h algobase.h alloc.h backward_warning.h bvector.h
108 BKWHDRS+=       complex.h defalloc.h deque.h fstream.h function.h hash_map.h
109 BKWHDRS+=       hash_set.h hashtable.h heap.h iomanip.h iostream.h istream.h
110 BKWHDRS+=       iterator.h list.h map.h multimap.h multiset.h new.h ostream.h
111 BKWHDRS+=       pair.h queue.h rope.h set.h slist.h stack.h stream.h
112 BKWHDRS+=       streambuf.h strstream tempbuf.h tree.h vector.h
113 BKWHDRS:=       ${BKWHDRS:S;^;${SRCDIR}/include/backward/;}
114 BKWHDRSDIR=     ${INCLUDEDIR}/c++/3.4/backward
115
116 DEBUGHDRS=      bitset debug.h deque formatter.h hash_map hash_map.h
117 DEBUGHDRS+=     hash_multimap.h hash_multiset.h hash_set hash_set.h list map
118 DEBUGHDRS+=     map.h multimap.h multiset.h safe_base.h safe_iterator.h
119 DEBUGHDRS+=     safe_iterator.tcc safe_sequence.h set set.h string vector
120 DEBUGHDRS:=     ${DEBUGHDRS:S;^;${SRCDIR}/include/debug/;}
121 DEBUGHDRSDIR=   ${INCLUDEDIR}/c++/3.4/debug
122
123 EXTHDRS=        algorithm bitmap_allocator.h debug_allocator.h
124 EXTHDRS+=       enc_filebuf.h functional hash_fun.h hash_map hash_set
125 EXTHDRS+=       hashtable.h iterator malloc_allocator.h memory mt_allocator.h
126 EXTHDRS+=       new_allocator.h numeric pod_char_traits.h pool_allocator.h
127 EXTHDRS+=       rb_tree rope ropeimpl.h slist stdio_filebuf.h
128 EXTHDRS+=       stdio_sync_filebuf.h
129 EXTHDRS:=       ${EXTHDRS:S;^;${SRCDIR}/include/ext/;}
130 EXTHDRSDIR=     ${INCLUDEDIR}/c++/3.4/ext
131
132 # This is the common subset of files that all three "C" header models use.
133 BASEHDRS=       std_cassert.h std_cctype.h std_cerrno.h std_cfloat.h
134 BASEHDRS+=      std_ciso646.h std_climits.h std_clocale.h std_cmath.h
135 BASEHDRS+=      std_csetjmp.h std_csignal.h std_cstdarg.h std_cstddef.h
136 BASEHDRS+=      std_cstdio.h std_cstdlib.h std_cstring.h std_ctime.h
137 BASEHDRS+=      std_cwchar.h std_cwctype.h
138 .for h in ${BASEHDRS}
139 BASEHDRSNAME_$h=${h:R:S;^std_;;}
140 .endfor
141 BASEHDRS:=      ${BASEHDRS:S;^;${SRCDIR}/include/c_std/;}
142 BASEHDRSDIR=    ${INCLUDEDIR}/c++/3.4
143
144 # Some of the different "C" header models need extra files.
145 BASEXHDRS=      ${SRCDIR}/include/c_std/cmath.tcc
146 BASEXHDRSDIR=   ${INCLUDEDIR}/c++/3.4/bits
147
148 STDHDRS=        std_algorithm.h std_bitset.h std_complex.h std_deque.h
149 STDHDRS+=       std_fstream.h std_functional.h std_iomanip.h std_ios.h
150 STDHDRS+=       std_iosfwd.h std_iostream.h std_istream.h std_iterator.h
151 STDHDRS+=       std_limits.h std_list.h std_locale.h std_map.h std_memory.h
152 STDHDRS+=       std_numeric.h std_ostream.h std_queue.h std_set.h
153 STDHDRS+=       std_sstream.h std_stack.h std_stdexcept.h std_streambuf.h
154 STDHDRS+=       std_string.h std_utility.h std_valarray.h std_vector.h
155 .for h in ${STDHDRS}
156 STDHDRSNAME_$h=${h:R:S;^std_;;}
157 .endfor
158 STDHDRS:=       ${STDHDRS:S;^;${SRCDIR}/include/std/;}
159 STDHDRSDIR=     ${INCLUDEDIR}/c++/3.4
160
161 # c++locale <- c_locale.h
162 TARGETHDRS=     io/basic_file_stdio.h io/c_io_stdio.h
163 TARGETHDRS+=    allocator/new_allocator_base.h
164 TARGETHDRS+=    os/bsd/netbsd/ctype_inline.h
165 TARGETHDRS+=    os/bsd/netbsd/os_defines.h
166 TARGETHDRS+=    locale/generic/messages_members.h locale/generic/time_members.h
167 TARGETHDRS+=    locale/generic/codecvt_specializations.h
168 TARGETHDRS+=    locale/generic/c_locale.h
169 TARGETHDRS:=    ${TARGETHDRS:S;^;${SRCDIR}/config/;} ctype_noninline.h \
170                 ctype_base.h os_defines.h
171
172 TARGETHDRSNAME_c_io_stdio.h=            c++io.h
173 TARGETHDRSNAME_new_allocator_base.h=    c++allocator.h
174 TARGETHDRSNAME_basic_file_stdio.h=      basic_file.h
175 TARGETHDRSNAME_c_locale.h=              c++locale.h
176 TARGETHDRS+=    ${.CURDIR}/c++config.h
177 TARGETHDRSDIR=  ${INCLUDEDIR}/c++/3.4/bits
178
179 MARCHHDRS=      atomic_word.h
180
181 .for h in ${MARCHHDRS}
182 .if exists(${SRCDIR}/config/cpu/${MARCHDIR}/${h})
183 TARGETHDRS+=    ${SRCDIR}/config/cpu/${MARCHDIR}/${h}
184 .else
185 TARGETHDRS+=    ${SRCDIR}/config/cpu/generic/${h}
186 .endif
187 .endfor
188
189 THRHDRS=        gthr.h gthr-single.h gthr-posix.h gthr-default.h
190 THRHDRSDIR=     ${INCLUDEDIR}/c++/3.4/bits
191
192 gthr.h: ${GCCDIR}/gcc/gthr.h
193         sed -e '/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCPP_\1/g' \
194             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
195             < ${GCCDIR}/gcc/gthr.h > gthr.h
196
197 gthr-single.h: ${GCCDIR}/gcc/gthr-single.h
198         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
199             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
200             < ${GCCDIR}/gcc/gthr-single.h > gthr-single.h
201
202 gthr-posix.h: ${GCCDIR}/gcc/gthr-posix.h
203         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
204             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
205             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
206             < ${GCCDIR}/gcc/gthr-posix.h > gthr-posix.h
207
208 gthr-default.h: ${GCCDIR}/gcc/gthr-posix.h
209         sed -e 's/\(UNUSED\)/_GLIBCPP_\1/g' \
210             -e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCPP_\1/g' \
211             -e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*WEAK\)/_GLIBCPP_\1/g' \
212             -e 's,^#include "\(.*\)",#include <bits/\1>,g' \
213             < ${GCCDIR}/gcc/gthr-posix.h > gthr-default.h
214
215 ctype_base.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h ctype_base.h.patch
216         patch -o ${.TARGET} -i ${.CURDIR}/ctype_base.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_base.h
217
218 ctype_noninline.h: ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h ctype_noninline.h.patch
219         patch -o ${.TARGET} -i ${.CURDIR}/ctype_noninline.h.patch ${SRCDIR}/config/os/bsd/netbsd/ctype_noninline.h
220
221 os_defines.h: ${SRCDIR}/config/os/bsd/netbsd/os_defines.h os_defines.h.patch
222         patch -o ${.TARGET} -i ${.CURDIR}/os_defines.h.patch ${SRCDIR}/config/os/bsd/netbsd/os_defines.h
223
224 CLEANFILES+=    ${THRHDRS} ctype_noninline.h ctype_base.h os_defines.h
225
226 .include <bsd.lib.mk>