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