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