xref: /freebsd/lib/libc++/Makefile (revision a812392203d7c4c3f0db9d8a0f3391374c49c71f)
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		__split_buffer\
79		__sso_allocator\
80		__std_stream\
81		__tree\
82		__tuple\
83		__tuple_03\
84		__undef_min_max\
85		algorithm\
86		array\
87		atomic\
88		bitset\
89		cassert\
90		ccomplex\
91		cctype\
92		cerrno\
93		cfenv\
94		cfloat\
95		chrono\
96		cinttypes\
97		ciso646\
98		climits\
99		clocale\
100		cmath\
101		codecvt\
102		complex\
103		complex.h\
104		condition_variable\
105		csetjmp\
106		csignal\
107		cstdarg\
108		cstdbool\
109		cstddef\
110		cstdint\
111		cstdio\
112		cstdlib\
113		cstring\
114		ctgmath\
115		ctime\
116		cwchar\
117		cwctype\
118		deque\
119		exception\
120		forward_list\
121		fstream\
122		functional\
123		future\
124		initializer_list\
125		iomanip\
126		ios\
127		iosfwd\
128		iostream\
129		istream\
130		iterator\
131		limits\
132		list\
133		locale\
134		map\
135		memory\
136		mutex\
137		new\
138		numeric\
139		ostream\
140		queue\
141		random\
142		ratio\
143		regex\
144		scoped_allocator\
145		set\
146		shared_mutex\
147		sstream\
148		stack\
149		stdexcept\
150		streambuf\
151		string\
152		strstream\
153		system_error\
154		tgmath.h\
155		thread\
156		tuple\
157		type_traits\
158		typeindex\
159		typeinfo\
160		unordered_map\
161		unordered_set\
162		utility\
163		valarray\
164		vector
165RT_HEADERS=	cxxabi.h\
166		unwind.h\
167		unwind-arm.h\
168		unwind-itanium.h
169
170.for hdr in ${STD_HEADERS}
171STD+=		${HDRDIR}/${hdr}
172INCSLINKS+=	${CXXINCLUDEDIR}/${hdr} ${CXXINCLUDEDIR}/tr1/${hdr}
173.endfor
174.for hdr in ${RT_HEADERS}
175STD+=		${LIBCXXRTDIR}/${hdr}
176.endfor
177STDDIR=		${CXXINCLUDEDIR}
178
179EXP_HEADERS=	dynarray\
180		optional
181
182.for hdr in ${EXP_HEADERS}
183EXP+=		${HDRDIR}/experimental/${hdr}
184.endfor
185EXPDIR=		${CXXINCLUDEDIR}/experimental
186
187EXT_HEADERS=	__hash\
188		hash_map\
189		hash_set
190
191.for hdr in ${EXT_HEADERS}
192EXT+=		${HDRDIR}/ext/${hdr}
193.endfor
194EXTDIR=		${CXXINCLUDEDIR}/ext
195
196.if ${MK_GNUCXX} == "no" && ${COMPILER_TYPE} == "gcc"
197CLEANFILES+=	libstdc++.so libstdc++.a
198
199afterinstall:
200	ln -sf ${DESTDIR}${LIBDIR}/lib${LIB}.so \
201		${.OBJDIR}/libstdc++.so
202	ln -sf ${DESTDIR}${LIBDIR}/lib${LIB}.a \
203		${.OBJDIR}/libstdc++.a
204.endif
205
206.include <bsd.lib.mk>
207