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