xref: /freebsd/lib/libc++/Makefile (revision f7c32ed617858bcd22f8d1b03199099d50125721)
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+=		format.cpp
32SRCS+=		functional.cpp
33SRCS+=		future.cpp
34SRCS+=		hash.cpp
35SRCS+=		ios.cpp
36SRCS+=		ios.instantiations.cpp
37SRCS+=		iostream.cpp
38SRCS+=		locale.cpp
39SRCS+=		memory.cpp
40SRCS+=		mutex.cpp
41SRCS+=		mutex_destructor.cpp
42SRCS+=		new.cpp
43SRCS+=		optional.cpp
44SRCS+=		random.cpp
45SRCS+=		random_shuffle.cpp
46SRCS+=		regex.cpp
47SRCS+=		shared_mutex.cpp
48SRCS+=		stdexcept.cpp
49SRCS+=		string.cpp
50SRCS+=		strstream.cpp
51SRCS+=		system_error.cpp
52SRCS+=		thread.cpp
53SRCS+=		typeinfo.cpp
54SRCS+=		utility.cpp
55SRCS+=		valarray.cpp
56SRCS+=		variant.cpp
57SRCS+=		vector.cpp
58
59CXXRT_SRCS+=	auxhelper.cc
60CXXRT_SRCS+=	dynamic_cast.cc
61CXXRT_SRCS+=	exception.cc
62CXXRT_SRCS+=	guard.cc
63CXXRT_SRCS+=	libelftc_dem_gnu3.c
64CXXRT_SRCS+=	memory.cc
65CXXRT_SRCS+=	stdexcept.cc
66CXXRT_SRCS+=	terminate.cc
67CXXRT_SRCS+=	typeinfo.cc
68
69.for _S in ${CXXRT_SRCS}
70CLEANFILES+=	cxxrt_${_S}
71STATICOBJS+=	cxxrt_${_S:R}.o
72cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA
73	ln -sf ${.ALLSRC} ${.TARGET}
74.endfor
75
76WARNS?=		0
77CFLAGS+=	-isystem ${.CURDIR}
78CFLAGS+=	-isystem ${HDRDIR}
79CFLAGS+=	-isystem ${_LIBCXXRTDIR}
80CFLAGS+=	-nostdinc++
81CFLAGS+=	-nostdlib
82CFLAGS+=	-D_LIBCPP_BUILDING_LIBRARY
83CFLAGS+=	-DLIBCXXRT
84CFLAGS+=	-ffunction-sections
85CFLAGS+=	-fdata-sections
86CXXSTD?=	c++14
87
88LIBADD+=	cxxrt
89
90INCSGROUPS+=	STD
91STDDIR=		${CXXINCLUDEDIR}
92STD_HEADERS+=	__availability
93STD_HEADERS+=	__bit_reference
94STD_HEADERS+=	__bits
95STD_HEADERS+=	__bsd_locale_defaults.h
96STD_HEADERS+=	__bsd_locale_fallbacks.h
97STD_HEADERS+=	__config
98STD_HEADERS+=	__debug
99STD_HEADERS+=	__errc
100STD_HEADERS+=	__function_like.h
101STD_HEADERS+=	__functional_base
102STD_HEADERS+=	__hash_table
103STD_HEADERS+=	__libcpp_version
104STD_HEADERS+=	__locale
105STD_HEADERS+=	__mutex_base
106STD_HEADERS+=	__node_handle
107STD_HEADERS+=	__nullptr
108STD_HEADERS+=	__split_buffer
109STD_HEADERS+=	__std_stream
110STD_HEADERS+=	__string
111STD_HEADERS+=	__threading_support
112STD_HEADERS+=	__tree
113STD_HEADERS+=	__tuple
114STD_HEADERS+=	__undef_macros
115STD_HEADERS+=	algorithm
116STD_HEADERS+=	any
117STD_HEADERS+=	array
118STD_HEADERS+=	atomic
119STD_HEADERS+=	barrier
120STD_HEADERS+=	bit
121STD_HEADERS+=	bitset
122STD_HEADERS+=	cassert
123STD_HEADERS+=	ccomplex
124STD_HEADERS+=	cctype
125STD_HEADERS+=	cerrno
126STD_HEADERS+=	cfenv
127STD_HEADERS+=	cfloat
128STD_HEADERS+=	charconv
129STD_HEADERS+=	chrono
130STD_HEADERS+=	cinttypes
131STD_HEADERS+=	ciso646
132STD_HEADERS+=	climits
133STD_HEADERS+=	clocale
134STD_HEADERS+=	cmath
135STD_HEADERS+=	codecvt
136STD_HEADERS+=	compare
137STD_HEADERS+=	complex
138STD_HEADERS+=	complex.h
139STD_HEADERS+=	concepts
140STD_HEADERS+=	condition_variable
141STD_HEADERS+=	csetjmp
142STD_HEADERS+=	csignal
143STD_HEADERS+=	cstdarg
144STD_HEADERS+=	cstdbool
145STD_HEADERS+=	cstddef
146STD_HEADERS+=	cstdint
147STD_HEADERS+=	cstdio
148STD_HEADERS+=	cstdlib
149STD_HEADERS+=	cstring
150STD_HEADERS+=	ctgmath
151STD_HEADERS+=	ctime
152STD_HEADERS+=	ctype.h
153STD_HEADERS+=	cwchar
154STD_HEADERS+=	cwctype
155STD_HEADERS+=	deque
156STD_HEADERS+=	errno.h
157STD_HEADERS+=	exception
158STD_HEADERS+=	execution
159STD_HEADERS+=	fenv.h
160STD_HEADERS+=	filesystem
161STD_HEADERS+=	float.h
162STD_HEADERS+=	format
163STD_HEADERS+=	forward_list
164STD_HEADERS+=	fstream
165STD_HEADERS+=	functional
166STD_HEADERS+=	future
167STD_HEADERS+=	initializer_list
168STD_HEADERS+=	inttypes.h
169STD_HEADERS+=	iomanip
170STD_HEADERS+=	ios
171STD_HEADERS+=	iosfwd
172STD_HEADERS+=	iostream
173STD_HEADERS+=	istream
174STD_HEADERS+=	iterator
175STD_HEADERS+=	latch
176STD_HEADERS+=	limits
177STD_HEADERS+=	limits.h
178STD_HEADERS+=	list
179STD_HEADERS+=	locale
180STD_HEADERS+=	locale.h
181STD_HEADERS+=	map
182STD_HEADERS+=	math.h
183STD_HEADERS+=	memory
184STD_HEADERS+=	module.modulemap
185STD_HEADERS+=	mutex
186STD_HEADERS+=	new
187STD_HEADERS+=	numbers
188STD_HEADERS+=	numeric
189STD_HEADERS+=	optional
190STD_HEADERS+=	ostream
191STD_HEADERS+=	queue
192STD_HEADERS+=	random
193STD_HEADERS+=	ranges
194STD_HEADERS+=	ratio
195STD_HEADERS+=	regex
196STD_HEADERS+=	scoped_allocator
197STD_HEADERS+=	semaphore
198STD_HEADERS+=	set
199STD_HEADERS+=	setjmp.h
200STD_HEADERS+=	shared_mutex
201STD_HEADERS+=	span
202STD_HEADERS+=	sstream
203STD_HEADERS+=	stack
204STD_HEADERS+=	stdbool.h
205STD_HEADERS+=	stddef.h
206STD_HEADERS+=	stdexcept
207STD_HEADERS+=	stdint.h
208STD_HEADERS+=	stdio.h
209STD_HEADERS+=	stdlib.h
210STD_HEADERS+=	streambuf
211STD_HEADERS+=	string
212STD_HEADERS+=	string.h
213STD_HEADERS+=	string_view
214STD_HEADERS+=	strstream
215STD_HEADERS+=	system_error
216STD_HEADERS+=	tgmath.h
217STD_HEADERS+=	thread
218STD_HEADERS+=	tuple
219STD_HEADERS+=	type_traits
220STD_HEADERS+=	typeindex
221STD_HEADERS+=	typeinfo
222STD_HEADERS+=	unordered_map
223STD_HEADERS+=	unordered_set
224STD_HEADERS+=	utility
225STD_HEADERS+=	valarray
226STD_HEADERS+=	variant
227STD_HEADERS+=	vector
228STD_HEADERS+=	version
229STD_HEADERS+=	wchar.h
230STD_HEADERS+=	wctype.h
231.for hdr in ${STD_HEADERS}
232STD+=		${HDRDIR}/${hdr}
233.endfor
234
235# Special case for __config_site, which as of libc++ 12.0.0 is generated by
236# CMake, and as of 13.0.0 installed side-by-side with__config.
237STD+=		${.CURDIR}/__config_site
238
239RT_HEADERS+=	cxxabi.h
240RT_HEADERS+=	unwind-arm.h
241RT_HEADERS+=	unwind-itanium.h
242RT_HEADERS+=	unwind.h
243.for hdr in ${RT_HEADERS}
244STD+=		${_LIBCXXRTDIR}/${hdr}
245.endfor
246
247INCSGROUPS+=	ALG
248ALGDIR=		${CXXINCLUDEDIR}/__algorithm
249ALG_HEADERS+=	adjacent_find.h
250ALG_HEADERS+=	all_of.h
251ALG_HEADERS+=	any_of.h
252ALG_HEADERS+=	binary_search.h
253ALG_HEADERS+=	clamp.h
254ALG_HEADERS+=	comp.h
255ALG_HEADERS+=	comp_ref_type.h
256ALG_HEADERS+=	copy.h
257ALG_HEADERS+=	copy_backward.h
258ALG_HEADERS+=	copy_if.h
259ALG_HEADERS+=	copy_n.h
260ALG_HEADERS+=	count.h
261ALG_HEADERS+=	count_if.h
262ALG_HEADERS+=	equal.h
263ALG_HEADERS+=	equal_range.h
264ALG_HEADERS+=	fill.h
265ALG_HEADERS+=	fill_n.h
266ALG_HEADERS+=	find.h
267ALG_HEADERS+=	find_end.h
268ALG_HEADERS+=	find_first_of.h
269ALG_HEADERS+=	find_if.h
270ALG_HEADERS+=	find_if_not.h
271ALG_HEADERS+=	for_each.h
272ALG_HEADERS+=	for_each_n.h
273ALG_HEADERS+=	generate.h
274ALG_HEADERS+=	generate_n.h
275ALG_HEADERS+=	half_positive.h
276ALG_HEADERS+=	includes.h
277ALG_HEADERS+=	inplace_merge.h
278ALG_HEADERS+=	is_heap.h
279ALG_HEADERS+=	is_heap_until.h
280ALG_HEADERS+=	is_partitioned.h
281ALG_HEADERS+=	is_permutation.h
282ALG_HEADERS+=	is_sorted.h
283ALG_HEADERS+=	is_sorted_until.h
284ALG_HEADERS+=	iter_swap.h
285ALG_HEADERS+=	lexicographical_compare.h
286ALG_HEADERS+=	lower_bound.h
287ALG_HEADERS+=	make_heap.h
288ALG_HEADERS+=	max.h
289ALG_HEADERS+=	max_element.h
290ALG_HEADERS+=	merge.h
291ALG_HEADERS+=	min.h
292ALG_HEADERS+=	min_element.h
293ALG_HEADERS+=	minmax.h
294ALG_HEADERS+=	minmax_element.h
295ALG_HEADERS+=	mismatch.h
296ALG_HEADERS+=	move.h
297ALG_HEADERS+=	move_backward.h
298ALG_HEADERS+=	next_permutation.h
299ALG_HEADERS+=	none_of.h
300ALG_HEADERS+=	nth_element.h
301ALG_HEADERS+=	partial_sort.h
302ALG_HEADERS+=	partial_sort_copy.h
303ALG_HEADERS+=	partition.h
304ALG_HEADERS+=	partition_copy.h
305ALG_HEADERS+=	partition_point.h
306ALG_HEADERS+=	pop_heap.h
307ALG_HEADERS+=	prev_permutation.h
308ALG_HEADERS+=	push_heap.h
309ALG_HEADERS+=	remove.h
310ALG_HEADERS+=	remove_copy.h
311ALG_HEADERS+=	remove_copy_if.h
312ALG_HEADERS+=	remove_if.h
313ALG_HEADERS+=	replace.h
314ALG_HEADERS+=	replace_copy.h
315ALG_HEADERS+=	replace_copy_if.h
316ALG_HEADERS+=	replace_if.h
317ALG_HEADERS+=	reverse.h
318ALG_HEADERS+=	reverse_copy.h
319ALG_HEADERS+=	rotate.h
320ALG_HEADERS+=	rotate_copy.h
321ALG_HEADERS+=	sample.h
322ALG_HEADERS+=	search.h
323ALG_HEADERS+=	search_n.h
324ALG_HEADERS+=	set_difference.h
325ALG_HEADERS+=	set_intersection.h
326ALG_HEADERS+=	set_symmetric_difference.h
327ALG_HEADERS+=	set_union.h
328ALG_HEADERS+=	shift_left.h
329ALG_HEADERS+=	shift_right.h
330ALG_HEADERS+=	shuffle.h
331ALG_HEADERS+=	sift_down.h
332ALG_HEADERS+=	sort.h
333ALG_HEADERS+=	sort_heap.h
334ALG_HEADERS+=	stable_partition.h
335ALG_HEADERS+=	stable_sort.h
336ALG_HEADERS+=	swap_ranges.h
337ALG_HEADERS+=	transform.h
338ALG_HEADERS+=	unique.h
339ALG_HEADERS+=	unique_copy.h
340ALG_HEADERS+=	unwrap_iter.h
341ALG_HEADERS+=	upper_bound.h
342.for hdr in ${ALG_HEADERS}
343ALG+=		${HDRDIR}/__algorithm/${hdr}
344.endfor
345
346INCSGROUPS+=	FMT
347FMTDIR=		${CXXINCLUDEDIR}/__format
348FMT_HEADERS+=	format_error.h
349FMT_HEADERS+=	format_parse_context.h
350.for hdr in ${FMT_HEADERS}
351FMT+=		${HDRDIR}/__format/${hdr}
352.endfor
353
354INCSGROUPS+=	FUN
355FUNDIR=		${CXXINCLUDEDIR}/__functional
356FUN_HEADERS+=	binary_function.h
357FUN_HEADERS+=	binary_negate.h
358FUN_HEADERS+=	bind.h
359FUN_HEADERS+=	bind_front.h
360FUN_HEADERS+=	binder1st.h
361FUN_HEADERS+=	binder2nd.h
362FUN_HEADERS+=	default_searcher.h
363FUN_HEADERS+=	function.h
364FUN_HEADERS+=	hash.h
365FUN_HEADERS+=	identity.h
366FUN_HEADERS+=	invoke.h
367FUN_HEADERS+=	is_transparent.h
368FUN_HEADERS+=	mem_fn.h
369FUN_HEADERS+=	mem_fun_ref.h
370FUN_HEADERS+=	not_fn.h
371FUN_HEADERS+=	operations.h
372FUN_HEADERS+=	perfect_forward.h
373FUN_HEADERS+=	pointer_to_binary_function.h
374FUN_HEADERS+=	pointer_to_unary_function.h
375FUN_HEADERS+=	ranges_operations.h
376FUN_HEADERS+=	reference_wrapper.h
377FUN_HEADERS+=	unary_function.h
378FUN_HEADERS+=	unary_negate.h
379FUN_HEADERS+=	unwrap_ref.h
380FUN_HEADERS+=	weak_result_type.h
381.for hdr in ${FUN_HEADERS}
382FUN+=		${HDRDIR}/__functional/${hdr}
383.endfor
384
385INCSGROUPS+=	IT
386ITDIR=		${CXXINCLUDEDIR}/__iterator
387IT_HEADERS+=	access.h
388IT_HEADERS+=	advance.h
389IT_HEADERS+=	back_insert_iterator.h
390IT_HEADERS+=	common_iterator.h
391IT_HEADERS+=	concepts.h
392IT_HEADERS+=	counted_iterator.h
393IT_HEADERS+=	data.h
394IT_HEADERS+=	default_sentinel.h
395IT_HEADERS+=	distance.h
396IT_HEADERS+=	empty.h
397IT_HEADERS+=	erase_if_container.h
398IT_HEADERS+=	front_insert_iterator.h
399IT_HEADERS+=	incrementable_traits.h
400IT_HEADERS+=	insert_iterator.h
401IT_HEADERS+=	istream_iterator.h
402IT_HEADERS+=	istreambuf_iterator.h
403IT_HEADERS+=	iter_move.h
404IT_HEADERS+=	iter_swap.h
405IT_HEADERS+=	iterator.h
406IT_HEADERS+=	iterator_traits.h
407IT_HEADERS+=	move_iterator.h
408IT_HEADERS+=	next.h
409IT_HEADERS+=	ostream_iterator.h
410IT_HEADERS+=	ostreambuf_iterator.h
411IT_HEADERS+=	prev.h
412IT_HEADERS+=	projected.h
413IT_HEADERS+=	readable_traits.h
414IT_HEADERS+=	reverse_access.h
415IT_HEADERS+=	reverse_iterator.h
416IT_HEADERS+=	size.h
417IT_HEADERS+=	wrap_iter.h
418.for hdr in ${IT_HEADERS}
419IT+=		${HDRDIR}/__iterator/${hdr}
420.endfor
421
422INCSGROUPS+=	MEM
423MEMDIR=		${CXXINCLUDEDIR}/__memory
424MEM_HEADERS+=	addressof.h
425MEM_HEADERS+=	allocation_guard.h
426MEM_HEADERS+=	allocator.h
427MEM_HEADERS+=	allocator_arg_t.h
428MEM_HEADERS+=	allocator_traits.h
429MEM_HEADERS+=	auto_ptr.h
430MEM_HEADERS+=	compressed_pair.h
431MEM_HEADERS+=	construct_at.h
432MEM_HEADERS+=	pointer_safety.h
433MEM_HEADERS+=	pointer_traits.h
434MEM_HEADERS+=	raw_storage_iterator.h
435MEM_HEADERS+=	shared_ptr.h
436MEM_HEADERS+=	temporary_buffer.h
437MEM_HEADERS+=	uninitialized_algorithms.h
438MEM_HEADERS+=	unique_ptr.h
439MEM_HEADERS+=	uses_allocator.h
440.for hdr in ${MEM_HEADERS}
441MEM+=		${HDRDIR}/__memory/${hdr}
442.endfor
443
444INCSGROUPS+=	RND
445RNDDIR=		${CXXINCLUDEDIR}/__random
446RND_HEADERS+=	uniform_int_distribution.h
447.for hdr in ${RND_HEADERS}
448RND+=		${HDRDIR}/__random/${hdr}
449.endfor
450
451INCSGROUPS+=	RNG
452RNGDIR=		${CXXINCLUDEDIR}/__ranges
453RNG_HEADERS+=	access.h
454RNG_HEADERS+=	all.h
455RNG_HEADERS+=	common_view.h
456RNG_HEADERS+=	concepts.h
457RNG_HEADERS+=	copyable_box.h
458RNG_HEADERS+=	dangling.h
459RNG_HEADERS+=	data.h
460RNG_HEADERS+=	drop_view.h
461RNG_HEADERS+=	empty.h
462RNG_HEADERS+=	empty_view.h
463RNG_HEADERS+=	enable_borrowed_range.h
464RNG_HEADERS+=	enable_view.h
465RNG_HEADERS+=	non_propagating_cache.h
466RNG_HEADERS+=	ref_view.h
467RNG_HEADERS+=	size.h
468RNG_HEADERS+=	subrange.h
469RNG_HEADERS+=	transform_view.h
470RNG_HEADERS+=	view_interface.h
471.for hdr in ${RNG_HEADERS}
472RNG+=		${HDRDIR}/__ranges/${hdr}
473.endfor
474
475INCSGROUPS+=	UTL
476UTLDIR=		${CXXINCLUDEDIR}/__utility
477UTL_HEADERS+=	__decay_copy.h
478UTL_HEADERS+=	as_const.h
479UTL_HEADERS+=	cmp.h
480UTL_HEADERS+=	declval.h
481UTL_HEADERS+=	exchange.h
482UTL_HEADERS+=	forward.h
483UTL_HEADERS+=	in_place.h
484UTL_HEADERS+=	integer_sequence.h
485UTL_HEADERS+=	move.h
486UTL_HEADERS+=	pair.h
487UTL_HEADERS+=	piecewise_construct.h
488UTL_HEADERS+=	rel_ops.h
489UTL_HEADERS+=	swap.h
490UTL_HEADERS+=	to_underlying.h
491.for hdr in ${UTL_HEADERS}
492UTL+=		${HDRDIR}/__utility/${hdr}
493.endfor
494
495INCSGROUPS+=	VAR
496VAR_HEADERS+=	monostate.h
497VARDIR=	${CXXINCLUDEDIR}/__variant
498.for hdr in ${VAR_HEADERS}
499VAR+=		${HDRDIR}/__variant/${hdr}
500.endfor
501
502INCSGROUPS+=	EXP
503EXPDIR=		${CXXINCLUDEDIR}/experimental
504EXP_HEADERS+=	__config
505EXP_HEADERS+=	__memory
506EXP_HEADERS+=	algorithm
507EXP_HEADERS+=	coroutine
508EXP_HEADERS+=	deque
509EXP_HEADERS+=	filesystem
510EXP_HEADERS+=	forward_list
511EXP_HEADERS+=	functional
512EXP_HEADERS+=	iterator
513EXP_HEADERS+=	list
514EXP_HEADERS+=	map
515EXP_HEADERS+=	memory_resource
516EXP_HEADERS+=	propagate_const
517EXP_HEADERS+=	regex
518EXP_HEADERS+=	set
519EXP_HEADERS+=	simd
520EXP_HEADERS+=	string
521EXP_HEADERS+=	type_traits
522EXP_HEADERS+=	unordered_map
523EXP_HEADERS+=	unordered_set
524EXP_HEADERS+=	utility
525EXP_HEADERS+=	vector
526.for hdr in ${EXP_HEADERS}
527EXP+=		${HDRDIR}/experimental/${hdr}
528.endfor
529
530INCSGROUPS+=	EXT
531EXTDIR=		${CXXINCLUDEDIR}/ext
532EXT_HEADERS+=	__hash
533EXT_HEADERS+=	hash_map
534EXT_HEADERS+=	hash_set
535.for hdr in ${EXT_HEADERS}
536EXT+=		${HDRDIR}/ext/${hdr}
537.endfor
538
539.include <bsd.lib.mk>
540