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