1#	@(#)Makefile	8.1 (Berkeley) 6/4/93
2# $FreeBSD: stable/11/lib/Makefile 360658 2020-05-05 12:59:04Z dim $
3
4.include <src.opts.mk>
5
6# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
7# of the other libraries.  These are built first with a .WAIT between them
8# and the main list to avoid needing a SUBDIR_DEPEND line on every library
9# naming just these few items.
10
11SUBDIR_BOOTSTRAP= \
12	csu \
13	.WAIT \
14	libc \
15	libc_nonshared \
16	libcompiler_rt \
17	${_libclang_rt} \
18	${_libcplusplus} \
19	${_libcxxrt} \
20	libelf \
21	libssp \
22	libssp_nonshared \
23	msun
24
25# The main list; please keep these sorted alphabetically.
26
27SUBDIR=	${SUBDIR_BOOTSTRAP} \
28	.WAIT \
29	libalias \
30	libarchive \
31	${_libatm} \
32	libauditd \
33	libbegemot \
34	${_libblacklist} \
35	libblocksruntime \
36	${_libbluetooth} \
37	${_libbsnmp} \
38	libbsdstat \
39	libbsm \
40	libbz2 \
41	libcalendar \
42	libcam \
43	libcapsicum \
44	${_libcasper} \
45	${_libcom_err} \
46	libcompat \
47	libcrypt \
48	libdevctl \
49	libdevdctl \
50	libdevinfo \
51	libdevstat \
52	${_libdl} \
53	libdwarf \
54	libedit \
55	${_libefivar} \
56	libelftc \
57	libevent \
58	libexecinfo \
59	libexpat \
60	libfetch \
61	libfigpar \
62	libgeom \
63	${_libgpio} \
64	${_libgssapi} \
65	${_librpcsec_gss} \
66	${_libiconv_modules} \
67	libipsec \
68	libjail \
69	libkiconv \
70	libkvm \
71	${_libldns} \
72	liblzma \
73	${_libmagic} \
74	libmemstat \
75	libmd \
76	${_libmilter} \
77	${_libmp} \
78	libmt \
79	${_libnandfs} \
80	lib80211 \
81	libnetbsd \
82	${_libnetgraph} \
83	${_libngatm} \
84	libnv \
85	libopenbsd \
86	libopie \
87	libpam \
88	libpcap \
89	${_libpe} \
90	libpjdlog \
91	${_libpmc} \
92	${_libproc} \
93	libprocstat \
94	${_libradius} \
95	librpcsvc \
96	librt \
97	${_librtld_db} \
98	libsbuf \
99	${_libsdp} \
100	${_libsm} \
101	libsmb \
102	${_libsmdb} \
103	${_libsmutil} \
104	libsqlite3 \
105	libstdbuf \
106	libstdthreads \
107	libsysdecode \
108	libtacplus \
109	${_libtelnet} \
110	${_libthr} \
111	libthread_db \
112	libucl \
113	libufs \
114	libugidfw \
115	libulog \
116	${_libunbound} \
117	${_libusbhid} \
118	${_libusb} \
119	libutil \
120	${_libvgl} \
121	${_libvmmapi} \
122	libwrap \
123	libxo \
124	liby \
125	${_libypclnt} \
126	libz \
127	ncurses \
128	${_atf} \
129	${_clang} \
130	${_cuse} \
131	${_tests}
132
133# Inter-library dependencies.  When the makefile for a library contains LDADD
134# libraries, those libraries should be listed as build order dependencies here.
135
136SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
137SUBDIR_DEPEND_libatm= libmd
138SUBDIR_DEPEND_libauditdm= libbsm
139SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
140SUBDIR_DEPEND_libc++:= libcxxrt
141# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
142# small enough to build that this bit of serialization is likely insignificant.
143SUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared
144SUBDIR_DEPEND_libcam= libsbuf
145SUBDIR_DEPEND_libcasper= libnv
146SUBDIR_DEPEND_libdevstat= libkvm
147SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
148SUBDIR_DEPEND_libedit= ncurses
149SUBDIR_DEPEND_libgeom= libexpat libsbuf
150SUBDIR_DEPEND_librpcsec_gss= libgssapi
151SUBDIR_DEPEND_libmagic= libz
152SUBDIR_DEPEND_libmemstat= libkvm
153SUBDIR_DEPEND_libopie= libmd
154SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err} 
155SUBDIR_DEPEND_libpjdlog= libutil
156SUBDIR_DEPEND_libprocstat= libkvm libutil
157SUBDIR_DEPEND_libradius= libmd
158SUBDIR_DEPEND_libsmb= libkiconv
159SUBDIR_DEPEND_libtacplus= libmd
160SUBDIR_DEPEND_libulog= libmd
161SUBDIR_DEPEND_libunbound= ${_libldns}
162SUBDIR_DEPEND_liblzma= ${_libthr}
163.if ${MK_OFED} != "no"
164SUBDIR_DEPEND_libpcap= ofed
165.endif
166
167# NB: keep these sorted by MK_* knobs
168
169.if ${MK_ATM} != "no"
170_libngatm=	libngatm
171.endif
172
173.if ${MK_BLACKLIST} != "no"
174_libblacklist=	libblacklist
175.endif
176
177.if ${MK_BLUETOOTH} != "no"
178_libbluetooth=	libbluetooth
179_libsdp=	libsdp
180.endif
181
182.if ${MK_BSNMP} != "no"
183_libbsnmp=	libbsnmp
184.endif
185
186.if ${MK_CASPER} != "no"
187_libcasper=	libcasper
188.endif
189
190.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
191_clang=		clang
192.endif
193
194.if ${MK_CUSE} != "no"
195_cuse=		libcuse
196.endif
197
198.if ${MK_TOOLCHAIN} != "no"
199_libpe=		libpe
200.endif
201
202SUBDIR.${MK_DIALOG}+=	libdpv
203
204.if ${MK_FILE} != "no"
205_libmagic=	libmagic
206.endif
207
208.if ${MK_GPIO} != "no"
209_libgpio=	libgpio
210.endif
211
212.if ${MK_GSSAPI} != "no"
213_libgssapi=	libgssapi
214_librpcsec_gss=	librpcsec_gss
215.endif
216
217.if ${MK_ICONV} != "no"
218_libiconv_modules=	libiconv_modules
219.endif
220
221.if ${MK_KERBEROS_SUPPORT} != "no"
222_libcom_err= libcom_err
223.endif
224
225.if ${MK_LDNS} != "no"
226_libldns=	libldns
227.endif
228
229# The libraries under libclang_rt can only be built by clang, and only make
230# sense to build when clang is enabled at all.  Furthermore, they can only be
231# built for certain architectures.
232.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
233    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
234    (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
235    (${MACHINE_CPUARCH} == "i386"))
236_libclang_rt=	libclang_rt
237.endif
238
239.if ${MK_LIBCPLUSPLUS} != "no"
240_libcxxrt=	libcxxrt
241_libcplusplus=	libc++ libc++experimental
242.endif
243
244.if ${MK_EFI} != "no"
245_libefivar=	libefivar
246.endif
247
248.if ${MK_LIBTHR} != "no"
249_libthr=	libthr
250.endif
251
252SUBDIR.${MK_LLVM_LIBUNWIND}+=	libgcc_eh
253SUBDIR.${MK_LLVM_LIBUNWIND}+=	libgcc_s
254
255.if ${MK_NAND} != "no"
256_libnandfs=	libnandfs
257.endif
258
259.if ${MK_NETGRAPH} != "no"
260_libnetgraph=	libnetgraph
261.endif
262
263.if ${MK_NIS} != "no"
264_libypclnt=	libypclnt
265.endif
266
267.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
268_libvgl=	libvgl
269_libproc=	libproc
270_librtld_db=	librtld_db
271.endif
272
273.if ${MACHINE_CPUARCH} == "amd64"
274.if ${MK_BHYVE} != "no"
275_libvmmapi=	libvmmapi
276.endif
277.endif
278
279.if ${MACHINE_CPUARCH} == "mips"
280_libproc=	libproc
281_librtld_db=	librtld_db
282.endif
283
284.if ${MACHINE_CPUARCH} == "powerpc"
285_libproc=	libproc
286_librtld_db=	librtld_db
287.endif
288
289.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter}
290_libdl=		libdl
291.endif
292
293.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
294    ${MACHINE_CPUARCH} == "riscv"
295_libproc=	libproc
296_librtld_db=	librtld_db
297.endif
298SUBDIR.${MK_OFED}+=	ofed
299SUBDIR.${MK_ZFS}+=	libbe
300
301.if ${MACHINE_ARCH} != "powerpc"
302SUBDIR.${MK_OPENMP}+=	libomp
303.endif
304
305.if ${MK_OPENSSL} != "no"
306_libmp=		libmp
307.endif
308
309.if ${MK_PMC} != "no"
310_libpmc=	libpmc
311.endif
312
313.if ${MK_RADIUS_SUPPORT} != "no"
314_libradius=	libradius
315.endif
316
317.if ${MK_SENDMAIL} != "no"
318_libmilter=	libmilter
319_libsm=		libsm
320_libsmdb=	libsmdb
321_libsmutil=	libsmutil
322.endif
323
324.if ${MK_TELNET} != "no"
325_libtelnet=	libtelnet
326.endif
327
328.if ${MK_TESTS_SUPPORT} != "no"
329_atf=		atf
330.endif
331.if ${MK_TESTS} != "no"
332_tests=		tests
333.endif
334
335.if ${MK_UNBOUND} != "no"
336_libunbound=	libunbound
337.endif
338
339.if ${MK_USB} != "no"
340_libusbhid=	libusbhid
341_libusb=	libusb
342.endif
343
344.if !make(install)
345SUBDIR_PARALLEL=
346.endif
347
348.include <bsd.subdir.mk>
349