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