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