xref: /freebsd/lib/Makefile (revision 123ae3045dd21badb93ce52445e18e364b3ac807)
158f0484fSRodney W. Grimes#	@(#)Makefile	8.1 (Berkeley) 6/4/93
27f3dea24SPeter Wemm# $FreeBSD$
3c9811e98SBruce Evans
4c6063d0dSWarner Losh.include <src.opts.mk>
5e1fe3dbaSRuslan Ermilov
6fa6d79e8SBryan Drewery# The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many
7a1c70d69SIan Lepore# of the other libraries.  These are built first with a .WAIT between them
8a1c70d69SIan Lepore# and the main list to avoid needing a SUBDIR_DEPEND line on every library
9a1c70d69SIan Lepore# naming just these few items.
10c9811e98SBruce Evans
11fa6d79e8SBryan DrewerySUBDIR_BOOTSTRAP= \
12fa6d79e8SBryan Drewery	csu \
13b8fffe16SWarner Losh	.WAIT \
149b3e440bSWarner Losh	libc \
15091b8336SPeter Wemm	libc_nonshared \
1639cd938cSEd Schouten	libcompiler_rt \
178028b78dSDimitry Andric	${_libclang_rt} \
18a1c70d69SIan Lepore	${_libcplusplus} \
1949c8e5e7SDimitry Andric	${_libcxxrt} \
20a1c70d69SIan Lepore	libelf \
21cd0d51baSKyle Evans	libssp \
22cd0d51baSKyle Evans	libssp_nonshared \
23a1c70d69SIan Lepore	msun
249b3e440bSWarner Losh
25a1c70d69SIan Lepore# The main list; please keep these sorted alphabetically.
2618de62a9SAlex Richardson# The only exception is sqlite3: we place it at the start of the list since it
2718de62a9SAlex Richardson# takes a long time to build and starting it first improves parallelism.
280e46933cSStanislav Sedov
29fa6d79e8SBryan DrewerySUBDIR=	${SUBDIR_BOOTSTRAP} \
30b8fffe16SWarner Losh	.WAIT \
3118de62a9SAlex Richardson	libsqlite3 \
32e4b0a90eSBrooks Davis	geom \
33100353cfSJakub Wojciech Klama	lib9p \
349b3e440bSWarner Losh	libalias \
359b3e440bSWarner Losh	libarchive \
36a1c70d69SIan Lepore	libauditd \
379b3e440bSWarner Losh	libbegemot \
3839cd938cSEd Schouten	libblocksruntime \
3981bd3d89SAdrian Chadd	libbsdstat \
40a1c70d69SIan Lepore	libbsm \
419b3e440bSWarner Losh	libbz2 \
429b3e440bSWarner Losh	libcalendar \
439b3e440bSWarner Losh	libcam \
447a6e3cf8SMariusz Zaborski	libcapsicum \
45ceb36bc9SMariusz Zaborski	libcasper \
469b3e440bSWarner Losh	libcompat \
47a1c70d69SIan Lepore	libcrypt \
4864de8019SJohn Baldwin	libdevctl \
499b3e440bSWarner Losh	libdevinfo \
509b3e440bSWarner Losh	libdevstat \
517c807d77SEd Maste	libdl \
529b3e440bSWarner Losh	libdwarf \
539b3e440bSWarner Losh	libedit \
545f8eed2fSEd Maste	libelftc \
55c5ea81f7SEd Maste	libevent1 \
564b1fb8ffSEd Maste	libexecinfo \
579b3e440bSWarner Losh	libexpat \
589b3e440bSWarner Losh	libfetch \
59041394f3SDevin Teske	libfigpar \
60c4501804SEd Maste	libgcc_eh \
61c4501804SEd Maste	libgcc_s \
629b3e440bSWarner Losh	libgeom \
63ec214349SKristof Provost	libifconfig \
649b3e440bSWarner Losh	libipsec \
659b3e440bSWarner Losh	libjail \
669b3e440bSWarner Losh	libkiconv \
67a1c70d69SIan Lepore	libkvm \
68564b9ff2SBrooks Davis	liblua \
6981ad8388SMartin Matuska	liblzma \
709b3e440bSWarner Losh	libmemstat \
71a1c70d69SIan Lepore	libmd \
7243518607SKenneth D. Merry	libmt \
73127be1a7SAdrian Chadd	lib80211 \
746bea8766SBrooks Davis	libnetbsd \
755c4f8d80SVincenzo Maffione	libnetmap \
76a1c70d69SIan Lepore	libnv \
77a36eca08SCraig Rodrigues	libopenbsd \
789b3e440bSWarner Losh	libopie \
799b3e440bSWarner Losh	libpam \
8082fcadcdSBryan Drewery	libpathconv \
81f39bffc6SKonstantin Belousov	libpcap \
82a1c70d69SIan Lepore	libpjdlog \
83feb2ecc3SWarner Losh	libproc \
840daf62d9SStanislav Sedov	libprocstat \
85b37f6c98SKyle Evans	libregex \
86a1c70d69SIan Lepore	librpcsvc \
8735c05a4fSAdrian Chadd	librss \
889b3e440bSWarner Losh	librt \
89feb2ecc3SWarner Losh	librtld_db \
90a1c70d69SIan Lepore	libsbuf \
9191ee3463SIan Lepore	libsmb \
926486b015SJeremie Le Hen	libstdbuf \
93fc6f0665SEd Schouten	libstdthreads \
94d6fb4894SJohn Baldwin	libsysdecode \
95a1c70d69SIan Lepore	libtacplus \
96*123ae304SKyle Evans	libthr \
979b3e440bSWarner Losh	libthread_db \
984ca4d6a8SBaptiste Daroussin	libucl \
999b3e440bSWarner Losh	libufs \
1009b3e440bSWarner Losh	libugidfw \
1019b3e440bSWarner Losh	libulog \
102a1c70d69SIan Lepore	libutil \
1039b3e440bSWarner Losh	${_libvgl} \
1049b3e440bSWarner Losh	libwrap \
105d7790611SMarcel Moolenaar	libxo \
1069b3e440bSWarner Losh	liby \
1079b3e440bSWarner Losh	libz \
108e2290905SBaptiste Daroussin	libzstd \
109cd060b8dSEd Maste	ncurses
11058f0484fSRodney W. Grimes
111a1c70d69SIan Lepore# Inter-library dependencies.  When the makefile for a library contains LDADD
112a1c70d69SIan Lepore# libraries, those libraries should be listed as build order dependencies here.
113a1c70d69SIan Lepore
114e4b0a90eSBrooks DavisSUBDIR_DEPEND_geom=	libufs
115eb578fecSKyle EvansSUBDIR_DEPEND_googletest= libregex
116d567f909SBaptiste DaroussinSUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd
117a1c70d69SIan LeporeSUBDIR_DEPEND_libauditdm= libbsm
118a1c70d69SIan LeporeSUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
119468a365dSBryan DrewerySUBDIR_DEPEND_libc++:= libcxxrt
120cd0d51baSKyle Evans# libssp_nonshared doesn't need to be linked into libc on every arch, but it is
121cd0d51baSKyle Evans# small enough to build that this bit of serialization is likely insignificant.
122cd0d51baSKyle EvansSUBDIR_DEPEND_libc= libcompiler_rt libssp_nonshared
123a1c70d69SIan LeporeSUBDIR_DEPEND_libcam= libsbuf
124c501d73cSMariusz ZaborskiSUBDIR_DEPEND_libcasper= libnv
125a1c70d69SIan LeporeSUBDIR_DEPEND_libdevstat= libkvm
1267fc89952SDevin TeskeSUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
127a1c70d69SIan LeporeSUBDIR_DEPEND_libedit= ncurses
128a1c70d69SIan LeporeSUBDIR_DEPEND_libgeom= libexpat libsbuf
129bc53c94fSEnji CooperSUBDIR_DEPEND_librpcsec_gss= libgssapi
130a1c70d69SIan LeporeSUBDIR_DEPEND_libmagic= libz
131a1c70d69SIan LeporeSUBDIR_DEPEND_libmemstat= libkvm
132a1c70d69SIan LeporeSUBDIR_DEPEND_libopie= libmd
13331a741f4SEnji CooperSUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
134a1c70d69SIan LeporeSUBDIR_DEPEND_libpjdlog= libutil
135a1c70d69SIan LeporeSUBDIR_DEPEND_libprocstat= libkvm libutil
136a1c70d69SIan LeporeSUBDIR_DEPEND_libradius= libmd
137a1c70d69SIan LeporeSUBDIR_DEPEND_libsmb= libkiconv
138b626f5a7SGlen BarberSUBDIR_DEPEND_libtacplus= libmd
139a1c70d69SIan LeporeSUBDIR_DEPEND_libulog= libmd
140a1c70d69SIan LeporeSUBDIR_DEPEND_libunbound= ${_libldns}
141*123ae304SKyle EvansSUBDIR_DEPEND_liblzma= libthr
142f39bffc6SKonstantin Belousov.if ${MK_OFED} != "no"
143f39bffc6SKonstantin BelousovSUBDIR_DEPEND_libpcap= ofed
144f39bffc6SKonstantin Belousov.endif
145a1c70d69SIan Lepore
14673577bf0SRyan Moeller.if !defined(COMPAT_32BIT)
14773577bf0SRyan MoellerSUBDIR+=	flua
14873577bf0SRyan MoellerSUBDIR_DEPEND_flua=	libjail
14973577bf0SRyan Moeller.endif
15073577bf0SRyan Moeller
151690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
152690f477dSSam Leffler
153cd060b8dSEd MasteSUBDIR.${MK_ATM}+=	libngatm
154a92958dfSSimon J. GerratySUBDIR.${MK_BEARSSL}+=	libbearssl libsecureboot
155cd060b8dSEd MasteSUBDIR.${MK_BLACKLIST}+=libblacklist
156cd060b8dSEd MasteSUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp
157cd060b8dSEd MasteSUBDIR.${MK_BSNMP}+=	libbsnmp
158cd060b8dSEd Maste
159cd060b8dSEd Maste.if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
160cd060b8dSEd MasteSUBDIR.${MK_CLANG}+=	clang
1615e1847b4SPoul-Henning Kamp.endif
1625e1847b4SPoul-Henning Kamp
163cd060b8dSEd MasteSUBDIR.${MK_CUSE}+= 	libcuse
164cd060b8dSEd MasteSUBDIR.${MK_CXX}+=	libdevdctl
1655f8eed2fSEd MasteSUBDIR.${MK_TOOLCHAIN}+=libpe
166f987297fSEd MasteSUBDIR.${MK_DIALOG}+=	libdpv
167cd060b8dSEd MasteSUBDIR.${MK_FILE}+=	libmagic
168cd060b8dSEd MasteSUBDIR.${MK_GPIO}+=	libgpio
169cd060b8dSEd MasteSUBDIR.${MK_GSSAPI}+=	libgssapi librpcsec_gss
170cd060b8dSEd MasteSUBDIR.${MK_ICONV}+=	libiconv_modules
171cd060b8dSEd MasteSUBDIR.${MK_KERBEROS_SUPPORT}+=	libcom_err
172cd060b8dSEd MasteSUBDIR.${MK_LDNS}+=	libldns
1731a13f2e6SEdward Tomasz NapieralaSUBDIR.${MK_STATS}+=	libstats
1747b5038d7SDag-Erling Smørgrav
1758028b78dSDimitry Andric# The libraries under libclang_rt can only be built by clang, and only make
1768028b78dSDimitry Andric# sense to build when clang is enabled at all.  Furthermore, they can only be
1778028b78dSDimitry Andric# built for certain architectures.
1788028b78dSDimitry Andric.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
179b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
1801bb8eb56SDimitry Andric    ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386" || \
1811bb8eb56SDimitry Andric    ${MACHINE_CPUARCH} == "powerpc")
1828028b78dSDimitry Andric_libclang_rt=	libclang_rt
1838028b78dSDimitry Andric.endif
1848028b78dSDimitry Andric
18535e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
18635e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
1878e69077bSDimitry Andric_libcplusplus=	libc++
1888e69077bSDimitry Andric_libcplusplus+=	libc++experimental
1898e69077bSDimitry Andric.endif
19035e370a2SDag-Erling Smørgrav
191cd060b8dSEd MasteSUBDIR.${MK_EFI}+=	libefivar
19243e25f47SEnji CooperSUBDIR.${MK_GOOGLETEST}+=	googletest
193cd060b8dSEd MasteSUBDIR.${MK_NETGRAPH}+=	libnetgraph
194cd060b8dSEd MasteSUBDIR.${MK_NIS}+=	libypclnt
195690f477dSSam Leffler
19625faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
197c9811e98SBruce Evans_libvgl=	libvgl
198abbb0b30SMarcel Moolenaar.endif
199abbb0b30SMarcel Moolenaar
200cde6fa28SRuslan Bukin.if ${MACHINE_CPUARCH} == "aarch64"
201cde6fa28SRuslan BukinSUBDIR.${MK_PMC}+=	libopencsd
202cde6fa28SRuslan Bukin.endif
203cde6fa28SRuslan Bukin
20470d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
20530b3274fSRuslan BukinSUBDIR.${MK_PMC}+=	libipt
206cd060b8dSEd MasteSUBDIR.${MK_BHYVE}+=	libvmmapi
20702629e46SEnji Cooper.endif
20870d8f36aSPeter Grehan
2096b3555c3SDimitry Andric.if ${MACHINE_ARCH} != "powerpc"
210b0840a28SDimitry AndricSUBDIR.${MK_OPENMP}+=	libomp
2116b3555c3SDimitry Andric.endif
212cd060b8dSEd MasteSUBDIR.${MK_OPENSSL}+=	libmp
213bc82609aSKyle EvansSUBDIR.${MK_PMC}+=	libpmc libpmcstat
214cd060b8dSEd MasteSUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
215cd060b8dSEd MasteSUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
216cd060b8dSEd MasteSUBDIR.${MK_TELNET}+=	libtelnet
217cd060b8dSEd MasteSUBDIR.${MK_TESTS_SUPPORT}+=	atf
218b0d29bc4SBrooks DavisSUBDIR.${MK_TESTS_SUPPORT}.${MK_CXX}+=	kyua
219c697fb7fSBrooks DavisSUBDIR.${MK_TESTS_SUPPORT}.${MK_CXX}+=	liblutok
220cd060b8dSEd MasteSUBDIR.${MK_TESTS}+=	tests
221cd060b8dSEd MasteSUBDIR.${MK_UNBOUND}+=	libunbound
222cd060b8dSEd MasteSUBDIR.${MK_USB}+=	libusbhid libusb
223f39bffc6SKonstantin BelousovSUBDIR.${MK_OFED}+=	ofed
224a92958dfSSimon J. GerratySUBDIR.${MK_VERIEXEC}+=	libveriexec
2257920ad94SKyle EvansSUBDIR.${MK_ZFS}+=	libbe
226a8ec1b48SMaxim Sobolev
22754ff5d73SDimitry Andric.if !make(install)
22854ff5d73SDimitry AndricSUBDIR_PARALLEL=
22954ff5d73SDimitry Andric.endif
23054ff5d73SDimitry Andric
23158f0484fSRodney W. Grimes.include <bsd.subdir.mk>
232