xref: /freebsd/lib/libc++/Makefile (revision 7447ca0eb235974642312b9555caec00b57d8fc1)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5PACKAGE=	clibs
6_LIBCXXRTDIR=	${.CURDIR}/../../contrib/libcxxrt
7HDRDIR=		${.CURDIR}/../../contrib/libc++/include
8SRCDIR=		${.CURDIR}/../../contrib/libc++/src
9CXXINCLUDEDIR=	${INCLUDEDIR}/c++/v${SHLIB_MAJOR}
10.if ${MACHINE_CPUARCH} == "arm"
11STATIC_CXXFLAGS+= -mlong-calls
12.endif
13
14.PATH: ${SRCDIR}
15
16LIB=		c++
17SHLIB_MAJOR=	1
18SHLIB_LDSCRIPT=	libc++.ldscript
19
20SRCS+=		algorithm.cpp\
21		any.cpp\
22		bind.cpp\
23		chrono.cpp\
24		condition_variable.cpp\
25		debug.cpp\
26		exception.cpp\
27		future.cpp\
28		hash.cpp\
29		ios.cpp\
30		iostream.cpp\
31		locale.cpp\
32		memory.cpp\
33		mutex.cpp\
34		new.cpp\
35		optional.cpp\
36		random.cpp\
37		regex.cpp\
38		shared_mutex.cpp\
39		stdexcept.cpp\
40		string.cpp\
41		strstream.cpp\
42		system_error.cpp\
43		thread.cpp\
44		typeinfo.cpp\
45		utility.cpp\
46		valarray.cpp
47
48CXXRT_SRCS+=	libelftc_dem_gnu3.c\
49		terminate.cc\
50		dynamic_cast.cc\
51		memory.cc\
52		auxhelper.cc\
53		exception.cc\
54		stdexcept.cc\
55		typeinfo.cc\
56		guard.cc
57
58.for _S in ${CXXRT_SRCS}
59CLEANFILES+=	cxxrt_${_S}
60STATICOBJS+=	cxxrt_${_S:R}.o
61cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA
62	ln -sf ${.ALLSRC} ${.TARGET}
63.endfor
64
65WARNS=		0
66CFLAGS+=	-isystem ${HDRDIR} -isystem ${_LIBCXXRTDIR} -nostdinc++ -nostdlib -DLIBCXXRT
67.if empty(CXXFLAGS:M-std=*)
68CXXFLAGS+=	-std=c++11
69.endif
70
71LIBADD+=	cxxrt
72INCSGROUPS=	STD EXP EXT
73
74STD_HEADERS=	__bit_reference\
75		__config\
76		__debug\
77		__functional_03\
78		__functional_base\
79		__functional_base_03\
80		__hash_table\
81		__locale\
82		__mutex_base\
83		__nullptr\
84		__refstring\
85		__split_buffer\
86		__sso_allocator\
87		__std_stream\
88		__tree\
89		__tuple\
90		__undef___deallocate\
91		__undef_min_max\
92		algorithm\
93		array\
94		atomic\
95		bitset\
96		cassert\
97		ccomplex\
98		cctype\
99		cerrno\
100		cfenv\
101		cfloat\
102		chrono\
103		cinttypes\
104		ciso646\
105		climits\
106		clocale\
107		cmath\
108		codecvt\
109		complex\
110		complex.h\
111		condition_variable\
112		csetjmp\
113		csignal\
114		cstdarg\
115		cstdbool\
116		cstddef\
117		cstdint\
118		cstdio\
119		cstdlib\
120		cstring\
121		ctgmath\
122		ctime\
123		ctype.h\
124		cwchar\
125		cwctype\
126		deque\
127		errno.h\
128		exception\
129		float.h\
130		forward_list\
131		fstream\
132		functional\
133		future\
134		initializer_list\
135		inttypes.h\
136		iomanip\
137		ios\
138		iosfwd\
139		iostream\
140		istream\
141		iterator\
142		limits\
143		list\
144		locale\
145		map\
146		math.h\
147		memory\
148		mutex\
149		new\
150		numeric\
151		ostream\
152		queue\
153		random\
154		ratio\
155		regex\
156		scoped_allocator\
157		set\
158		setjmp.h\
159		shared_mutex\
160		sstream\
161		stack\
162		stddef.h\
163		stdexcept\
164		stdio.h\
165		stdlib.h\
166		streambuf\
167		string\
168		strstream\
169		system_error\
170		tgmath.h\
171		thread\
172		tuple\
173		type_traits\
174		typeindex\
175		typeinfo\
176		unordered_map\
177		unordered_set\
178		utility\
179		valarray\
180		vector\
181		wchar.h\
182		wctype.h
183RT_HEADERS=	cxxabi.h\
184		unwind.h\
185		unwind-arm.h\
186		unwind-itanium.h
187
188.for hdr in ${STD_HEADERS}
189STD+=		${HDRDIR}/${hdr}
190INCSLINKS+=	../${hdr} ${CXXINCLUDEDIR}/tr1/${hdr}
191.endfor
192.for hdr in ${RT_HEADERS}
193STD+=		${_LIBCXXRTDIR}/${hdr}
194.endfor
195STDDIR=		${CXXINCLUDEDIR}
196
197EXP_HEADERS=	__config\
198		algorithm\
199		any\
200		chrono\
201		dynarray\
202		functional\
203		optional\
204		ratio\
205		string_view\
206		system_error\
207		tuple\
208		type_traits\
209		utility
210
211.for hdr in ${EXP_HEADERS}
212EXP+=		${HDRDIR}/experimental/${hdr}
213.endfor
214EXPDIR=		${CXXINCLUDEDIR}/experimental
215
216EXT_HEADERS=	__hash\
217		hash_map\
218		hash_set
219
220.for hdr in ${EXT_HEADERS}
221EXT+=		${HDRDIR}/ext/${hdr}
222.endfor
223EXTDIR=		${CXXINCLUDEDIR}/ext
224
225.if ${MK_GNUCXX} == "no" && ${COMPILER_TYPE} == "gcc"
226CLEANFILES+=	libstdc++.so libstdc++.a
227
228afterinstall:
229	${INSTALL_SYMLINK} ${DESTDIR}${LIBDIR}/lib${LIB}.so \
230		${.OBJDIR}/libstdc++.so
231	${INSTALL_SYMLINK} ${DESTDIR}${LIBDIR}/lib${LIB}.a \
232		${.OBJDIR}/libstdc++.a
233.endif
234
235.include <bsd.lib.mk>
236