xref: /freebsd/lib/Makefile (revision 0f5c86ddb0257f4b7620f1d8e898289be30b19bf)
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	libauditd \
38	libbegemot \
39	libblocksruntime \
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	libgeom \
65	libifconfig \
66	libipsec \
67	libiscsiutil \
68	libjail \
69	libkiconv \
70	libkldelf \
71	libkvm \
72	liblua \
73	liblzma \
74	libmemstat \
75	libmd \
76	libmixer \
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	${_libvgl} \
109	libwrap \
110	libxo \
111	liby \
112	libyaml \
113	libz \
114	libzstd \
115	ncurses \
116	nss_tacplus
117
118# Inter-library dependencies.  When the makefile for a library contains LDADD
119# libraries, those libraries should be listed as build order dependencies here.
120
121SUBDIR_DEPEND_geom=	libufs
122SUBDIR_DEPEND_googletest= libregex
123SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
124SUBDIR_DEPEND_libauditdm= libbsm
125SUBDIR_DEPEND_libbsddialog= ncurses
126SUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
127SUBDIR_DEPEND_libc++:= libcxxrt
128# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
129# small enough to build that this bit of serialization is likely insignificant.
130SUBDIR_DEPEND_libc= libsys libcompiler_rt libssp_nonshared
131SUBDIR_DEPEND_libcam= libsbuf
132SUBDIR_DEPEND_libcasper= libnv
133SUBDIR_DEPEND_libcrypt= libmd
134SUBDIR_DEPEND_libdevstat= libkvm
135SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
136SUBDIR_DEPEND_libedit= ncurses
137SUBDIR_DEPEND_libgeom= libexpat libsbuf
138SUBDIR_DEPEND_librpcsec_gss= libgssapi
139SUBDIR_DEPEND_libmagic= libz
140SUBDIR_DEPEND_libmemstat= libkvm
141SUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
142SUBDIR_DEPEND_libpjdlog= libutil
143SUBDIR_DEPEND_libprocstat= libkvm libutil
144SUBDIR_DEPEND_libradius= libmd
145SUBDIR_DEPEND_libsmb= libkiconv
146# See comment above about libssp_nonshared
147SUBDIR_DEPEND_libsys= libcompiler_rt libssp_nonshared
148SUBDIR_DEPEND_libtacplus= libmd
149SUBDIR_DEPEND_libulog= libmd
150SUBDIR_DEPEND_libunbound= ${_libldns}
151SUBDIR_DEPEND_liblzma= libthr
152.if ${MK_OFED} != "no"
153SUBDIR_DEPEND_libpcap= ofed
154.endif
155SUBDIR_DEPEND_nss_tacplus= libtacplus
156
157# NB: keep these sorted by MK_* knobs
158
159SUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
160SUBDIR.${MK_BLACKLIST}+=libblacklist
161SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
162SUBDIR.${MK_BSNMP}+=	libbsnmp
163
164.if !defined(COMPAT_LIBCOMPAT)
165.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \
166    ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no"
167SUBDIR+=	clang
168.endif
169.endif
170
171SUBDIR.${MK_CUSE}+= 	libcuse
172SUBDIR.${MK_TOOLCHAIN}+=libpe
173SUBDIR.${MK_DIALOG}+=	libdpv libfigpar
174SUBDIR.${MK_FDT}+=	libfdt
175SUBDIR.${MK_FILE}+=	libmagic
176SUBDIR.${MK_GPIO}+=	libgpio
177SUBDIR.${MK_GSSAPI}+=	libgssapi librpcsec_gss
178SUBDIR.${MK_ICONV}+=	libiconv_modules
179.if ${MK_MITKRB5} == "no"
180SUBDIR.${MK_KERBEROS_SUPPORT}+=	libcom_err
181.endif
182SUBDIR.${MK_LDNS}+=	libldns
183SUBDIR.${MK_STATS}+=	libstats
184
185# The libraries under libclang_rt can only be built by clang.
186.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \
187    ${MK_CLANG} != "no"
188_libclang_rt=	libclang_rt
189.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
190.error Requested build with sanitizers but cannot build runtime libraries!
191.endif
192
193# This construct disables libefivar for 32-bit build.
194.if ${MACHINE_CPUARCH} != "i386"
195SUBDIR.${MK_EFI}+=	libefivar
196.endif
197SUBDIR.${MK_GOOGLETEST}+=	googletest
198SUBDIR.${MK_NETGRAPH}+=	libnetgraph
199SUBDIR.${MK_NIS}+=	libypclnt
200
201.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
202_libvgl=	libvgl
203.endif
204
205.if ${MACHINE_CPUARCH} == "aarch64"
206SUBDIR.${MK_PMC}+=	libopencsd
207.endif
208
209.if ${MACHINE_CPUARCH} == "amd64"
210SUBDIR.${MK_PMC}+=	libipt
211.endif
212
213.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
214    ${MACHINE_CPUARCH} == "riscv"
215SUBDIR.${MK_BHYVE}+=	libvmmapi
216.endif
217
218.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm"
219SUBDIR.${MK_OPENMP}+=	libomp
220.endif
221.if ${MK_USB} != "no"
222SUBDIR.${MK_OPENSSH}+=	libcbor libfido2
223.endif
224SUBDIR.${MK_OPENSSL}+=	libmp
225SUBDIR.${MK_PF}+=	libpfctl
226SUBDIR.${MK_PMC}+=	libpmc libpmcstat
227SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
228SUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
229SUBDIR.${MK_TELNET}+=	libtelnet
230SUBDIR.${MK_TESTS_SUPPORT}+=	atf
231SUBDIR.${MK_TESTS_SUPPORT}+=	liblutok
232SUBDIR.${MK_TESTS}+=	tests
233SUBDIR.${MK_UNBOUND}+=	libunbound
234SUBDIR.${MK_USB}+=	libusbhid libusb
235SUBDIR.${MK_OFED}+=	ofed
236SUBDIR.${MK_VERIEXEC}+=	libveriexec
237SUBDIR.${MK_ZFS}+=	libbe
238
239.if !make(install)
240SUBDIR_PARALLEL=
241.endif
242
243.include <bsd.subdir.mk>
244