xref: /freebsd/lib/Makefile (revision 3fe5961a0b708da599d42cbb6b5e4f030c28ea45)
1c6063d0dSWarner Losh.include <src.opts.mk>
2e1fe3dbaSRuslan Ermilov
3fa6d79e8SBryan Drewery# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
4a1c70d69SIan Lepore# of the other libraries.  These are built first with a .WAIT between them
5a1c70d69SIan Lepore# and the main list to avoid needing a SUBDIR_DEPEND line on every library
6a1c70d69SIan Lepore# naming just these few items.
7c9811e98SBruce Evans
8fa6d79e8SBryan DrewerySUBDIR_BOOTSTRAP= \
9fa6d79e8SBryan Drewery	csu \
10b8fffe16SWarner Losh	.WAIT \
119b3e440bSWarner Losh	libc \
12091b8336SPeter Wemm	libc_nonshared \
1339cd938cSEd Schouten	libcompiler_rt \
148028b78dSDimitry Andric	${_libclang_rt} \
15ac4c695aSEd Maste	libc++ \
16ac4c695aSEd Maste	libc++experimental \
17ac4c695aSEd Maste	libcxxrt \
18f59bb61eSKyle Evans	libder \
19d9a9f23dSDag-Erling Smørgrav	libdiff \
20a1c70d69SIan Lepore	libelf \
21cd0d51baSKyle Evans	libssp \
22cd0d51baSKyle Evans	libssp_nonshared \
23e9d96105SBrooks Davis	libsys \
24a1c70d69SIan Lepore	msun
259b3e440bSWarner Losh
26a1c70d69SIan Lepore# The main list; please keep these sorted alphabetically.
2718de62a9SAlex Richardson# The only exception is sqlite3: we place it at the start of the list since it
2818de62a9SAlex Richardson# takes a long time to build and starting it first improves parallelism.
290e46933cSStanislav Sedov
30fa6d79e8SBryan DrewerySUBDIR=	${SUBDIR_BOOTSTRAP} \
31b8fffe16SWarner Losh	.WAIT \
3218de62a9SAlex Richardson	libsqlite3 \
33e4b0a90eSBrooks Davis	geom \
34100353cfSJakub Wojciech Klama	lib9p \
359b3e440bSWarner Losh	libalias \
369b3e440bSWarner Losh	libarchive \
379b3e440bSWarner Losh	libbegemot \
3839cd938cSEd Schouten	libblocksruntime \
39*3fe5961aSDevin Teske	libbsdconf \
4037d0601fSBaptiste Daroussin	libbsddialog \
4181bd3d89SAdrian Chadd	libbsdstat \
42a1c70d69SIan Lepore	libbsm \
439b3e440bSWarner Losh	libbz2 \
449b3e440bSWarner Losh	libcalendar \
459b3e440bSWarner Losh	libcam \
467a6e3cf8SMariusz Zaborski	libcapsicum \
47ceb36bc9SMariusz Zaborski	libcasper \
489b3e440bSWarner Losh	libcompat \
49a1c70d69SIan Lepore	libcrypt \
5064de8019SJohn Baldwin	libdevctl \
51ac4c695aSEd Maste	libdevdctl \
529b3e440bSWarner Losh	libdevinfo \
539b3e440bSWarner Losh	libdevstat \
547c807d77SEd Maste	libdl \
559b3e440bSWarner Losh	libdwarf \
569b3e440bSWarner Losh	libedit \
575f8eed2fSEd Maste	libelftc \
58c5ea81f7SEd Maste	libevent1 \
594b1fb8ffSEd Maste	libexecinfo \
609b3e440bSWarner Losh	libexpat \
619b3e440bSWarner Losh	libfetch \
62c4501804SEd Maste	libgcc_eh \
63c4501804SEd Maste	libgcc_s \
649b3e440bSWarner Losh	libgeom \
65ec214349SKristof Provost	libifconfig \
669b3e440bSWarner Losh	libipsec \
6763783933SJohn Baldwin	libiscsiutil \
689b3e440bSWarner Losh	libjail \
699b3e440bSWarner Losh	libkiconv \
70968bcca2SKa Ho Ng	libkldelf \
71a1c70d69SIan Lepore	libkvm \
72564b9ff2SBrooks Davis	liblua \
7381ad8388SMartin Matuska	liblzma \
749b3e440bSWarner Losh	libmemstat \
75a1c70d69SIan Lepore	libmd \
7643518607SKenneth D. Merry	libmt \
77127be1a7SAdrian Chadd	lib80211 \
786bea8766SBrooks Davis	libnetbsd \
795c4f8d80SVincenzo Maffione	libnetmap \
80a1c70d69SIan Lepore	libnv \
812da066efSJohn Baldwin	libnvmf \
82a36eca08SCraig Rodrigues	libopenbsd \
839b3e440bSWarner Losh	libpam \
8482fcadcdSBryan Drewery	libpathconv \
85f39bffc6SKonstantin Belousov	libpcap \
86a1c70d69SIan Lepore	libpjdlog \
87feb2ecc3SWarner Losh	libproc \
880daf62d9SStanislav Sedov	libprocstat \
89b37f6c98SKyle Evans	libregex \
90a1c70d69SIan Lepore	librpcsvc \
9135c05a4fSAdrian Chadd	librss \
929b3e440bSWarner Losh	librt \
93feb2ecc3SWarner Losh	librtld_db \
94a1c70d69SIan Lepore	libsbuf \
9591ee3463SIan Lepore	libsmb \
966486b015SJeremie Le Hen	libstdbuf \
97fc6f0665SEd Schouten	libstdthreads \
98d6fb4894SJohn Baldwin	libsysdecode \
99a1c70d69SIan Lepore	libtacplus \
100123ae304SKyle Evans	libthr \
1019b3e440bSWarner Losh	libthread_db \
1024ca4d6a8SBaptiste Daroussin	libucl \
1039b3e440bSWarner Losh	libufs \
1049b3e440bSWarner Losh	libugidfw \
1059b3e440bSWarner Losh	libulog \
106a1c70d69SIan Lepore	libutil \
107b3127a2dSJohn Baldwin	libutil++ \
1081ecf0106SKonstantin Belousov	libuvmem \
1099b3e440bSWarner Losh	${_libvgl} \
1109b3e440bSWarner Losh	libwrap \
111d7790611SMarcel Moolenaar	libxo \
1129b3e440bSWarner Losh	liby \
1130f5c86ddSBaptiste Daroussin	libyaml \
1149b3e440bSWarner Losh	libz \
115e2290905SBaptiste Daroussin	libzstd \
1166c5cdba1SDag-Erling Smørgrav	ncurses \
117f040ee6eSChristos Margiolis	nss_tacplus
11858f0484fSRodney W. Grimes
119a1c70d69SIan Lepore# Inter-library dependencies.  When the makefile for a library contains LDADD
120a1c70d69SIan Lepore# libraries, those libraries should be listed as build order dependencies here.
121a1c70d69SIan Lepore
122e4b0a90eSBrooks DavisSUBDIR_DEPEND_geom=	libufs
123eb578fecSKyle EvansSUBDIR_DEPEND_googletest= libregex
124d567f909SBaptiste DaroussinSUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
125a1c70d69SIan LeporeSUBDIR_DEPEND_libauditdm= libbsm
1265abafe4aSBaptiste DaroussinSUBDIR_DEPEND_libbsddialog= ncurses
127a1c70d69SIan LeporeSUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
128468a365dSBryan DrewerySUBDIR_DEPEND_libc++:= libcxxrt
129cd0d51baSKyle Evans# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
130cd0d51baSKyle Evans# small enough to build that this bit of serialization is likely insignificant.
1310d4f7723SBrooks DavisSUBDIR_DEPEND_libc= libsys libcompiler_rt libssp_nonshared
132a1c70d69SIan LeporeSUBDIR_DEPEND_libcam= libsbuf
133c501d73cSMariusz ZaborskiSUBDIR_DEPEND_libcasper= libnv
134cb5e41b1SRobert ClauseckerSUBDIR_DEPEND_libcrypt= libmd
135a1c70d69SIan LeporeSUBDIR_DEPEND_libdevstat= libkvm
136a1c70d69SIan LeporeSUBDIR_DEPEND_libedit= ncurses
137a1c70d69SIan LeporeSUBDIR_DEPEND_libgeom= libexpat libsbuf
138e26259f4SCy Schubert.if ${MK_MITKRB5} == "no"
139bc53c94fSEnji CooperSUBDIR_DEPEND_librpcsec_gss= libgssapi
140e26259f4SCy Schubert.endif
141a1c70d69SIan LeporeSUBDIR_DEPEND_libmagic= libz
142a1c70d69SIan LeporeSUBDIR_DEPEND_libmemstat= libkvm
1430aa27001SDag-Erling SmørgravSUBDIR_DEPEND_libpam= libcrypt ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
144a1c70d69SIan LeporeSUBDIR_DEPEND_libpjdlog= libutil
145a1c70d69SIan LeporeSUBDIR_DEPEND_libprocstat= libkvm libutil
146a1c70d69SIan LeporeSUBDIR_DEPEND_libradius= libmd
147a1c70d69SIan LeporeSUBDIR_DEPEND_libsmb= libkiconv
148e9d96105SBrooks Davis# See comment above about libssp_nonshared
149e9d96105SBrooks DavisSUBDIR_DEPEND_libsys= libcompiler_rt libssp_nonshared
150b626f5a7SGlen BarberSUBDIR_DEPEND_libtacplus= libmd
151a1c70d69SIan LeporeSUBDIR_DEPEND_libulog= libmd
152a1c70d69SIan LeporeSUBDIR_DEPEND_libunbound= ${_libldns}
153123ae304SKyle EvansSUBDIR_DEPEND_liblzma= libthr
154f39bffc6SKonstantin Belousov.if ${MK_OFED} != "no"
155f39bffc6SKonstantin BelousovSUBDIR_DEPEND_libpcap= ofed
156f39bffc6SKonstantin Belousov.endif
1576c5cdba1SDag-Erling SmørgravSUBDIR_DEPEND_nss_tacplus= libtacplus
1589cab9fdeSChristos MargiolisSUBDIR_DEPEND_virtual_oss= libsamplerate
159a1c70d69SIan Lepore
160690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
161690f477dSSam Leffler
162a92958dfSSimon J. GerratySUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
163cd060b8dSEd MasteSUBDIR.${MK_BLACKLIST}+=libblacklist
16472383174SJose Luis DuranSUBDIR.${MK_BLOCKLIST}+=libblocklist
165cd060b8dSEd MasteSUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
166cd060b8dSEd MasteSUBDIR.${MK_BSNMP}+=	libbsnmp
167cd060b8dSEd Maste
1683864bd4fSJessica Clarke.if !defined(COMPAT_LIBCOMPAT)
169021385abSAlex Richardson.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \
170021385abSAlex Richardson    ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no"
171021385abSAlex RichardsonSUBDIR+=	clang
172021385abSAlex Richardson.endif
1735e1847b4SPoul-Henning Kamp.endif
1745e1847b4SPoul-Henning Kamp
175b13d7062SLexi WinterSUBDIR.${MK_AUDIT}+=	libauditd
176cd060b8dSEd MasteSUBDIR.${MK_CUSE}+= 	libcuse
1775f8eed2fSEd MasteSUBDIR.${MK_TOOLCHAIN}+=libpe
178f29af861SMark JohnstonSUBDIR.${MK_FDT}+=	libfdt
179cd060b8dSEd MasteSUBDIR.${MK_FILE}+=	libmagic
180cd060b8dSEd MasteSUBDIR.${MK_GPIO}+=	libgpio
181e26259f4SCy Schubert.if ${MK_MITKRB5} == "no"
182dc5ba6b8SLexi WinterSUBDIR.${MK_KERBEROS}+=	libgssapi
183e26259f4SCy Schubert.endif
184dc5ba6b8SLexi WinterSUBDIR.${MK_KERBEROS}+=	librpcsec_gss
185cd060b8dSEd MasteSUBDIR.${MK_ICONV}+=	libiconv_modules
1860acf1dd7SCy Schubert.if ${MK_MITKRB5} == "no"
187dc5ba6b8SLexi WinterSUBDIR.${MK_KERBEROS}+=	libcom_err
1880acf1dd7SCy Schubert.endif
189cd060b8dSEd MasteSUBDIR.${MK_LDNS}+=	libldns
190b8352da3SPierre ProncherySUBDIR.${MK_PKGCONF}+=	libpkgconf
1911a13f2e6SEdward Tomasz NapieralaSUBDIR.${MK_STATS}+=	libstats
1927b5038d7SDag-Erling Smørgrav
193ac4c695aSEd Maste# The libraries under libclang_rt can only be built by clang.
19420c63662SMark Johnston.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \
19520c63662SMark Johnston    ${MK_CLANG} != "no"
1968028b78dSDimitry Andric_libclang_rt=	libclang_rt
1972a31cd21SEd Maste.elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all)
1986f6fbfa3SEd Maste.error Requested build with sanitizers but cannot build runtime libraries!
1998028b78dSDimitry Andric.endif
2008028b78dSDimitry Andric
201e35cc7baSWarner Losh# This construct disables libefivar for 32-bit build.
202e35cc7baSWarner Losh.if ${MACHINE_CPUARCH} != "i386"
203cd060b8dSEd MasteSUBDIR.${MK_EFI}+=	libefivar
204e35cc7baSWarner Losh.endif
20543e25f47SEnji CooperSUBDIR.${MK_GOOGLETEST}+=	googletest
206cd060b8dSEd MasteSUBDIR.${MK_NETGRAPH}+=	libnetgraph
207cd060b8dSEd MasteSUBDIR.${MK_NIS}+=	libypclnt
208690f477dSSam Leffler
20925faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
210c9811e98SBruce Evans_libvgl=	libvgl
211abbb0b30SMarcel Moolenaar.endif
212abbb0b30SMarcel Moolenaar
213cde6fa28SRuslan Bukin.if ${MACHINE_CPUARCH} == "aarch64"
214cde6fa28SRuslan BukinSUBDIR.${MK_PMC}+=	libopencsd
215cde6fa28SRuslan Bukin.endif
216cde6fa28SRuslan Bukin
21770d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
21830b3274fSRuslan BukinSUBDIR.${MK_PMC}+=	libipt
21911c79f9eSMark Johnston.endif
22011c79f9eSMark Johnston
2217ab1a32cSRuslan Bukin.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
2227ab1a32cSRuslan Bukin    ${MACHINE_CPUARCH} == "riscv"
223cd060b8dSEd MasteSUBDIR.${MK_BHYVE}+=	libvmmapi
22402629e46SEnji Cooper.endif
22570d8f36aSPeter Grehan
226a1b67573SMike Karels.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_CPUARCH} != "arm"
227b0840a28SDimitry AndricSUBDIR.${MK_OPENMP}+=	libomp
2286b3555c3SDimitry Andric.endif
2296adfb815SJessica Clarke.if ${MK_USB} != "no"
2307b1e19adSEd MasteSUBDIR.${MK_OPENSSH}+=	libcbor libfido2
2312e85df65SEd Maste.endif
232cd060b8dSEd MasteSUBDIR.${MK_OPENSSL}+=	libmp
2330d71f9f3SKristof ProvostSUBDIR.${MK_PF}+=	libpfctl
234bc82609aSKyle EvansSUBDIR.${MK_PMC}+=	libpmc libpmcstat
235cd060b8dSEd MasteSUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
236cd060b8dSEd MasteSUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
237cd060b8dSEd MasteSUBDIR.${MK_TELNET}+=	libtelnet
238f74f8915SChristos MargiolisSUBDIR.${MK_SOUND}+=	libmixer
239baa7a870SLexi WinterSUBDIR.${MK_CUSE}.${MK_SOUND}+=	libsamplerate virtual_oss
240cd060b8dSEd MasteSUBDIR.${MK_TESTS_SUPPORT}+=	atf
241ac4c695aSEd MasteSUBDIR.${MK_TESTS_SUPPORT}+=	liblutok
242cd060b8dSEd MasteSUBDIR.${MK_TESTS}+=	tests
243cd060b8dSEd MasteSUBDIR.${MK_UNBOUND}+=	libunbound
244cd060b8dSEd MasteSUBDIR.${MK_USB}+=	libusbhid libusb
245f39bffc6SKonstantin BelousovSUBDIR.${MK_OFED}+=	ofed
246a92958dfSSimon J. GerratySUBDIR.${MK_VERIEXEC}+=	libveriexec
2477920ad94SKyle EvansSUBDIR.${MK_ZFS}+=	libbe
248a8ec1b48SMaxim Sobolev
24954ff5d73SDimitry Andric.if !make(install)
25054ff5d73SDimitry AndricSUBDIR_PARALLEL=
25154ff5d73SDimitry Andric.endif
25254ff5d73SDimitry Andric
25358f0484fSRodney W. Grimes.include <bsd.subdir.mk>
254