xref: /freebsd/lib/Makefile (revision 222210c6a82282de78aa863c550da21471630316)
1.include <src.opts.mk>
2
3# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
4# of the other libraries.  These are built first with a .WAIT between them
5# and the main list to avoid needing a SUBDIR_DEPEND line on every library
6# naming just these few items.
7
8SUBDIR_BOOTSTRAP= \
9	csu \
10	.WAIT \
11	libc \
12	libc_nonshared \
13	libcompiler_rt \
14	${_libclang_rt} \
15	libc++ \
16	libc++experimental \
17	libcxxrt \
18	libder \
19	libdiff \
20	libelf \
21	libssp \
22	libssp_nonshared \
23	libsys \
24	msun
25
26# The main list; please keep these sorted alphabetically.
27# The only exception is sqlite3: we place it at the start of the list since it
28# takes a long time to build and starting it first improves parallelism.
29
30SUBDIR=	${SUBDIR_BOOTSTRAP} \
31	.WAIT \
32	libsqlite3 \
33	geom \
34	lib9p \
35	libalias \
36	libarchive \
37	libbegemot \
38	libblocksruntime \
39	libbsdconf \
40	libbsddialog \
41	libbsdstat \
42	libbsm \
43	libbz2 \
44	libcalendar \
45	libcam \
46	libcapsicum \
47	libcasper \
48	libcompat \
49	libcrypt \
50	libdevctl \
51	libdevdctl \
52	libdevinfo \
53	libdevstat \
54	libdl \
55	libdwarf \
56	libedit \
57	libelftc \
58	libevent1 \
59	libexecinfo \
60	libexpat \
61	libfetch \
62	libgcc_eh \
63	libgcc_s \
64	libgcc_s_asneeded \
65	libgeom \
66	libifconfig \
67	libipsec \
68	libiscsiutil \
69	libjail \
70	libkiconv \
71	libkldelf \
72	libkvm \
73	liblua \
74	liblzma \
75	libmemstat \
76	libmd \
77	libmt \
78	lib80211 \
79	libnetbsd \
80	libnetmap \
81	libnv \
82	libnvmf \
83	libopenbsd \
84	libpam \
85	libpathconv \
86	libpcap \
87	libpjdlog \
88	libproc \
89	libprocstat \
90	libregex \
91	librpcsvc \
92	librss \
93	librt \
94	librtld_db \
95	libsbuf \
96	libsmb \
97	libstdbuf \
98	libstdthreads \
99	libsysdecode \
100	libtacplus \
101	libthr \
102	libthread_db \
103	libucl \
104	libufs \
105	libugidfw \
106	libulog \
107	libutil \
108	libutil++ \
109	libuvmem \
110	${_libvgl} \
111	libwrap \
112	libxo \
113	liby \
114	libyaml \
115	libz \
116	libzstd \
117	ncurses \
118	nss_tacplus
119
120# Inter-library dependencies.  When the makefile for a library contains LDADD
121# libraries, those libraries should be listed as build order dependencies here.
122
123SUBDIR_DEPEND_geom=	libufs
124SUBDIR_DEPEND_googletest= libregex
125SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
126SUBDIR_DEPEND_libauditdm= libbsm
127SUBDIR_DEPEND_libbsddialog= ncurses
128SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
129SUBDIR_DEPEND_libc++:= libcxxrt
130# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
131# small enough to build that this bit of serialization is likely insignificant.
132SUBDIR_DEPEND_libc= libsys libcompiler_rt libssp_nonshared
133SUBDIR_DEPEND_libcam= libsbuf
134SUBDIR_DEPEND_libcasper= libnv
135SUBDIR_DEPEND_libcrypt= libmd
136SUBDIR_DEPEND_libdevstat= libkvm
137SUBDIR_DEPEND_libedit= ncurses
138SUBDIR_DEPEND_libgeom= libexpat libsbuf
139.if ${MK_MITKRB5} == "no"
140SUBDIR_DEPEND_librpcsec_gss= libgssapi
141.endif
142SUBDIR_DEPEND_libmagic= libz
143SUBDIR_DEPEND_libmemstat= libkvm
144SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
145SUBDIR_DEPEND_libpjdlog= libutil
146SUBDIR_DEPEND_libprocstat= libkvm libutil
147SUBDIR_DEPEND_libradius= libmd
148SUBDIR_DEPEND_libsmb= libkiconv
149# See comment above about libssp_nonshared
150SUBDIR_DEPEND_libsys= libcompiler_rt libssp_nonshared
151SUBDIR_DEPEND_libtacplus= libmd
152SUBDIR_DEPEND_libulog= libmd
153SUBDIR_DEPEND_libunbound= ${_libldns}
154SUBDIR_DEPEND_liblzma= libthr
155.if ${MK_OFED} != "no"
156SUBDIR_DEPEND_libpcap= ofed
157.endif
158SUBDIR_DEPEND_nss_tacplus= libtacplus
159SUBDIR_DEPEND_virtual_oss= libsamplerate
160
161# NB: keep these sorted by MK_* knobs
162
163SUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
164SUBDIR.${MK_BLACKLIST}+=libblacklist
165SUBDIR.${MK_BLOCKLIST}+=libblocklist
166SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
167SUBDIR.${MK_BSNMP}+=	libbsnmp
168
169.if !defined(COMPAT_LIBCOMPAT)
170.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \
171    ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no"
172SUBDIR+=	clang
173.endif
174.endif
175
176SUBDIR.${MK_AUDIT}+=	libauditd
177SUBDIR.${MK_CUSE}+= 	libcuse
178SUBDIR.${MK_TOOLCHAIN}+=libpe
179SUBDIR.${MK_FDT}+=	libfdt
180SUBDIR.${MK_FILE}+=	libmagic
181SUBDIR.${MK_GPIO}+=	libgpio
182.if ${MK_MITKRB5} == "no"
183SUBDIR.${MK_KERBEROS}+=	libgssapi
184.endif
185SUBDIR.${MK_KERBEROS}+=	librpcsec_gss
186SUBDIR.${MK_ICONV}+=	libiconv_modules
187.if ${MK_MITKRB5} == "no"
188SUBDIR.${MK_KERBEROS}+=	libcom_err
189.endif
190SUBDIR.${MK_LDNS}+=	libldns
191SUBDIR.${MK_PKGCONF}+=	libpkgconf
192SUBDIR.${MK_STATS}+=	libstats
193
194# The libraries under libclang_rt can only be built by clang.
195.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \
196    ${MK_CLANG} != "no"
197_libclang_rt=	libclang_rt
198.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
199.error Requested build with sanitizers but cannot build runtime libraries!
200.endif
201
202# This construct disables libefivar for 32-bit build.
203.if ${MACHINE_CPUARCH} != "i386"
204SUBDIR.${MK_EFI}+=	libefivar
205.endif
206SUBDIR.${MK_GOOGLETEST}+=	googletest
207SUBDIR.${MK_NETGRAPH}+=	libnetgraph
208SUBDIR.${MK_NIS}+=	libypclnt
209
210.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
211_libvgl=	libvgl
212.endif
213
214.if ${MACHINE_CPUARCH} == "aarch64"
215SUBDIR.${MK_PMC}+=	libopencsd
216.endif
217
218.if ${MACHINE_CPUARCH} == "amd64"
219SUBDIR.${MK_PMC}+=	libipt
220.endif
221
222.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
223    ${MACHINE_CPUARCH} == "riscv"
224SUBDIR.${MK_BHYVE}+=	libvmmapi
225.endif
226
227.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm"
228SUBDIR.${MK_OPENMP}+=	libomp
229.endif
230.if ${MK_USB} != "no"
231SUBDIR.${MK_OPENSSH}+=	libcbor libfido2
232.endif
233SUBDIR.${MK_OPENSSL}+=	libmp
234SUBDIR.${MK_PF}+=	libpfctl
235SUBDIR.${MK_PMC}+=	libpmc libpmcstat
236SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
237SUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
238SUBDIR.${MK_TELNET}+=	libtelnet
239SUBDIR.${MK_SOUND}+=	libmixer
240SUBDIR.${MK_CUSE}.${MK_SOUND}+=	libsamplerate virtual_oss
241SUBDIR.${MK_TESTS_SUPPORT}+=	atf
242SUBDIR.${MK_TESTS_SUPPORT}+=	liblutok
243SUBDIR.${MK_TESTS}+=	tests
244SUBDIR.${MK_UNBOUND}+=	libunbound
245SUBDIR.${MK_USB}+=	libusbhid libusb
246SUBDIR.${MK_OFED}+=	ofed
247SUBDIR.${MK_VERIEXEC}+=	libveriexec
248SUBDIR.${MK_ZFS}+=	libbe
249
250.if !make(install)
251SUBDIR_PARALLEL=
252.endif
253
254.include <bsd.subdir.mk>
255