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