xref: /freebsd/lib/libc++/Makefile (revision 3231251399f9e60fc7175b6352eb5291e9296fe8)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5PACKAGE=	clibs
6_LIBCXXRTDIR=	${SRCTOP}/contrib/libcxxrt
7HDRDIR=		${SRCTOP}/contrib/libc++/include
8SRCDIR=		${SRCTOP}/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
21SRCS+=		any.cpp
22SRCS+=		bind.cpp
23SRCS+=		charconv.cpp
24SRCS+=		chrono.cpp
25SRCS+=		condition_variable.cpp
26SRCS+=		debug.cpp
27SRCS+=		exception.cpp
28SRCS+=		functional.cpp
29SRCS+=		future.cpp
30SRCS+=		hash.cpp
31SRCS+=		ios.cpp
32SRCS+=		iostream.cpp
33SRCS+=		locale.cpp
34SRCS+=		memory.cpp
35SRCS+=		mutex.cpp
36SRCS+=		new.cpp
37SRCS+=		optional.cpp
38SRCS+=		random.cpp
39SRCS+=		regex.cpp
40SRCS+=		shared_mutex.cpp
41SRCS+=		stdexcept.cpp
42SRCS+=		string.cpp
43SRCS+=		strstream.cpp
44SRCS+=		system_error.cpp
45SRCS+=		thread.cpp
46SRCS+=		typeinfo.cpp
47SRCS+=		utility.cpp
48SRCS+=		valarray.cpp
49SRCS+=		variant.cpp
50SRCS+=		vector.cpp
51
52CXXRT_SRCS+=	auxhelper.cc
53CXXRT_SRCS+=	dynamic_cast.cc
54CXXRT_SRCS+=	exception.cc
55CXXRT_SRCS+=	guard.cc
56CXXRT_SRCS+=	libelftc_dem_gnu3.c
57CXXRT_SRCS+=	memory.cc
58CXXRT_SRCS+=	stdexcept.cc
59CXXRT_SRCS+=	terminate.cc
60CXXRT_SRCS+=	typeinfo.cc
61
62.for _S in ${CXXRT_SRCS}
63CLEANFILES+=	cxxrt_${_S}
64STATICOBJS+=	cxxrt_${_S:R}.o
65cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA
66	ln -sf ${.ALLSRC} ${.TARGET}
67.endfor
68
69WARNS=		0
70CFLAGS+=	-isystem ${HDRDIR}
71CFLAGS+=	-isystem ${_LIBCXXRTDIR}
72CFLAGS+=	-nostdinc++
73CFLAGS+=	-nostdlib
74CFLAGS+=	-D_LIBCPP_BUILDING_LIBRARY
75CFLAGS+=	-DLIBCXXRT
76.if empty(CXXFLAGS:M-std=*)
77CXXFLAGS+=	-std=c++11
78.endif
79
80LIBADD+=	cxxrt
81INCSGROUPS=	STD EXP EXT
82
83STD_HEADERS+=	__bit_reference
84STD_HEADERS+=	__bsd_locale_defaults.h
85STD_HEADERS+=	__bsd_locale_fallbacks.h
86STD_HEADERS+=	__config
87STD_HEADERS+=	__debug
88STD_HEADERS+=	__errc
89STD_HEADERS+=	__functional_03
90STD_HEADERS+=	__functional_base
91STD_HEADERS+=	__functional_base_03
92STD_HEADERS+=	__hash_table
93STD_HEADERS+=	__libcpp_version
94STD_HEADERS+=	__locale
95STD_HEADERS+=	__mutex_base
96STD_HEADERS+=	__node_handle
97STD_HEADERS+=	__nullptr
98STD_HEADERS+=	__split_buffer
99STD_HEADERS+=	__sso_allocator
100STD_HEADERS+=	__std_stream
101STD_HEADERS+=	__string
102STD_HEADERS+=	__threading_support
103STD_HEADERS+=	__tree
104STD_HEADERS+=	__tuple
105STD_HEADERS+=	__undef_macros
106STD_HEADERS+=	algorithm
107STD_HEADERS+=	any
108STD_HEADERS+=	array
109STD_HEADERS+=	atomic
110STD_HEADERS+=	bitset
111STD_HEADERS+=	cassert
112STD_HEADERS+=	ccomplex
113STD_HEADERS+=	cctype
114STD_HEADERS+=	cerrno
115STD_HEADERS+=	cfenv
116STD_HEADERS+=	cfloat
117STD_HEADERS+=	charconv
118STD_HEADERS+=	chrono
119STD_HEADERS+=	cinttypes
120STD_HEADERS+=	ciso646
121STD_HEADERS+=	climits
122STD_HEADERS+=	clocale
123STD_HEADERS+=	cmath
124STD_HEADERS+=	codecvt
125STD_HEADERS+=	compare
126STD_HEADERS+=	complex
127STD_HEADERS+=	complex.h
128STD_HEADERS+=	condition_variable
129STD_HEADERS+=	csetjmp
130STD_HEADERS+=	csignal
131STD_HEADERS+=	cstdarg
132STD_HEADERS+=	cstdbool
133STD_HEADERS+=	cstddef
134STD_HEADERS+=	cstdint
135STD_HEADERS+=	cstdio
136STD_HEADERS+=	cstdlib
137STD_HEADERS+=	cstring
138STD_HEADERS+=	ctgmath
139STD_HEADERS+=	ctime
140STD_HEADERS+=	ctype.h
141STD_HEADERS+=	cwchar
142STD_HEADERS+=	cwctype
143STD_HEADERS+=	deque
144STD_HEADERS+=	errno.h
145STD_HEADERS+=	exception
146STD_HEADERS+=	filesystem
147STD_HEADERS+=	float.h
148STD_HEADERS+=	forward_list
149STD_HEADERS+=	fstream
150STD_HEADERS+=	functional
151STD_HEADERS+=	future
152STD_HEADERS+=	initializer_list
153STD_HEADERS+=	inttypes.h
154STD_HEADERS+=	iomanip
155STD_HEADERS+=	ios
156STD_HEADERS+=	iosfwd
157STD_HEADERS+=	iostream
158STD_HEADERS+=	istream
159STD_HEADERS+=	iterator
160STD_HEADERS+=	limits
161STD_HEADERS+=	limits.h
162STD_HEADERS+=	list
163STD_HEADERS+=	locale
164STD_HEADERS+=	locale.h
165STD_HEADERS+=	map
166STD_HEADERS+=	math.h
167STD_HEADERS+=	memory
168STD_HEADERS+=	mutex
169STD_HEADERS+=	new
170STD_HEADERS+=	numeric
171STD_HEADERS+=	optional
172STD_HEADERS+=	ostream
173STD_HEADERS+=	queue
174STD_HEADERS+=	random
175STD_HEADERS+=	ratio
176STD_HEADERS+=	regex
177STD_HEADERS+=	scoped_allocator
178STD_HEADERS+=	set
179STD_HEADERS+=	setjmp.h
180STD_HEADERS+=	shared_mutex
181STD_HEADERS+=	span
182STD_HEADERS+=	sstream
183STD_HEADERS+=	stack
184STD_HEADERS+=	stdbool.h
185STD_HEADERS+=	stddef.h
186STD_HEADERS+=	stdexcept
187STD_HEADERS+=	stdint.h
188STD_HEADERS+=	stdio.h
189STD_HEADERS+=	stdlib.h
190STD_HEADERS+=	streambuf
191STD_HEADERS+=	string
192STD_HEADERS+=	string.h
193STD_HEADERS+=	string_view
194STD_HEADERS+=	strstream
195STD_HEADERS+=	system_error
196STD_HEADERS+=	tgmath.h
197STD_HEADERS+=	thread
198STD_HEADERS+=	tuple
199STD_HEADERS+=	type_traits
200STD_HEADERS+=	typeindex
201STD_HEADERS+=	typeinfo
202STD_HEADERS+=	unordered_map
203STD_HEADERS+=	unordered_set
204STD_HEADERS+=	utility
205STD_HEADERS+=	valarray
206STD_HEADERS+=	variant
207STD_HEADERS+=	vector
208STD_HEADERS+=	version
209STD_HEADERS+=	wchar.h
210STD_HEADERS+=	wctype.h
211
212RT_HEADERS+=	cxxabi.h
213RT_HEADERS+=	unwind-arm.h
214RT_HEADERS+=	unwind-itanium.h
215RT_HEADERS+=	unwind.h
216
217.for hdr in ${STD_HEADERS}
218STD+=		${HDRDIR}/${hdr}
219INCSLINKS+=	../${hdr} ${CXXINCLUDEDIR}/tr1/${hdr}
220.endfor
221.for hdr in ${RT_HEADERS}
222STD+=		${_LIBCXXRTDIR}/${hdr}
223.endfor
224STDDIR=		${CXXINCLUDEDIR}
225
226EXP_HEADERS+=	__config
227EXP_HEADERS+=	__memory
228EXP_HEADERS+=	algorithm
229EXP_HEADERS+=	any
230EXP_HEADERS+=	chrono
231EXP_HEADERS+=	coroutine
232EXP_HEADERS+=	deque
233EXP_HEADERS+=	dynarray
234EXP_HEADERS+=	filesystem
235EXP_HEADERS+=	forward_list
236EXP_HEADERS+=	functional
237EXP_HEADERS+=	iterator
238EXP_HEADERS+=	list
239EXP_HEADERS+=	map
240EXP_HEADERS+=	memory_resource
241EXP_HEADERS+=	numeric
242EXP_HEADERS+=	optional
243EXP_HEADERS+=	propagate_const
244EXP_HEADERS+=	ratio
245EXP_HEADERS+=	regex
246EXP_HEADERS+=	set
247EXP_HEADERS+=	simd
248EXP_HEADERS+=	string
249EXP_HEADERS+=	string_view
250EXP_HEADERS+=	system_error
251EXP_HEADERS+=	tuple
252EXP_HEADERS+=	type_traits
253EXP_HEADERS+=	unordered_map
254EXP_HEADERS+=	unordered_set
255EXP_HEADERS+=	utility
256EXP_HEADERS+=	vector
257
258.for hdr in ${EXP_HEADERS}
259EXP+=		${HDRDIR}/experimental/${hdr}
260.endfor
261EXPDIR=		${CXXINCLUDEDIR}/experimental
262
263EXT_HEADERS+=	__hash
264EXT_HEADERS+=	hash_map
265EXT_HEADERS+=	hash_set
266
267.for hdr in ${EXT_HEADERS}
268EXT+=		${HDRDIR}/ext/${hdr}
269.endfor
270EXTDIR=		${CXXINCLUDEDIR}/ext
271
272.include <bsd.lib.mk>
273