xref: /freebsd/lib/Makefile (revision ec21434933d775bd60d0fed62c978fb07fa9ccdf)
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 \
21a1c70d69SIan Lepore	msun
229b3e440bSWarner Losh
23a1c70d69SIan Lepore# The main list; please keep these sorted alphabetically.
240e46933cSStanislav Sedov
25fa6d79e8SBryan DrewerySUBDIR=	${SUBDIR_BOOTSTRAP} \
26b8fffe16SWarner Losh	.WAIT \
279b3e440bSWarner Losh	libalias \
289b3e440bSWarner Losh	libarchive \
299b3e440bSWarner Losh	${_libatm} \
30a1c70d69SIan Lepore	libauditd \
319b3e440bSWarner Losh	libbegemot \
3295856e14SKurt Lidl	${_libblacklist} \
3339cd938cSEd Schouten	libblocksruntime \
349b3e440bSWarner Losh	${_libbluetooth} \
359b3e440bSWarner Losh	${_libbsnmp} \
3681bd3d89SAdrian Chadd	libbsdstat \
37a1c70d69SIan Lepore	libbsm \
389b3e440bSWarner Losh	libbz2 \
399b3e440bSWarner Losh	libcalendar \
409b3e440bSWarner Losh	libcam \
4142a85952SPawel Jakub Dawidek	${_libcasper} \
42a1c70d69SIan Lepore	${_libcom_err} \
439b3e440bSWarner Losh	libcompat \
44a1c70d69SIan Lepore	libcrypt \
4564de8019SJohn Baldwin	libdevctl \
46903b0dd7SEd Maste	${_libdevdctl} \
479b3e440bSWarner Losh	libdevinfo \
489b3e440bSWarner Losh	libdevstat \
497fc89952SDevin Teske	libdpv \
509b3e440bSWarner Losh	libdwarf \
519b3e440bSWarner Losh	libedit \
5231942939SEd Maste	${_libelftc} \
530d9e60c8SBryan Drewery	libevent \
544b1fb8ffSEd Maste	libexecinfo \
559b3e440bSWarner Losh	libexpat \
569b3e440bSWarner Losh	libfetch \
57041394f3SDevin Teske	libfigpar \
589b3e440bSWarner Losh	libgeom \
593b09bf5eSEnji Cooper	${_libgpio} \
609b3e440bSWarner Losh	${_libgssapi} \
619b3e440bSWarner Losh	${_librpcsec_gss} \
62a1c70d69SIan Lepore	${_libiconv_modules} \
63*ec214349SKristof Provost	libifconfig \
649b3e440bSWarner Losh	libipsec \
659b3e440bSWarner Losh	libjail \
669b3e440bSWarner Losh	libkiconv \
67a1c70d69SIan Lepore	libkvm \
68a1c70d69SIan Lepore	${_libldns} \
6981ad8388SMartin Matuska	liblzma \
70c7b6816fSEnji Cooper	${_libmagic} \
719b3e440bSWarner Losh	libmemstat \
72a1c70d69SIan Lepore	libmd \
739b3e440bSWarner Losh	${_libmilter} \
749b3e440bSWarner Losh	${_libmp} \
7543518607SKenneth D. Merry	libmt \
767f725bcdSGrzegorz Bernacki	${_libnandfs} \
77127be1a7SAdrian Chadd	lib80211 \
786bea8766SBrooks Davis	libnetbsd \
79a1c70d69SIan Lepore	${_libnetgraph} \
809b3e440bSWarner Losh	${_libngatm} \
81a1c70d69SIan Lepore	libnv \
82a36eca08SCraig Rodrigues	libopenbsd \
839b3e440bSWarner Losh	libopie \
849b3e440bSWarner Losh	libpam \
859b3e440bSWarner Losh	libpcap \
86c1da2974SEd Maste	${_libpe} \
87a1c70d69SIan Lepore	libpjdlog \
889b3e440bSWarner Losh	${_libpmc} \
8954bb94d7SRui Paulo	${_libproc} \
900daf62d9SStanislav Sedov	libprocstat \
9131a741f4SEnji Cooper	${_libradius} \
92a1c70d69SIan Lepore	librpcsvc \
939b3e440bSWarner Losh	librt \
94fb05b666SRui Paulo	${_librtld_db} \
95a1c70d69SIan Lepore	libsbuf \
969b3e440bSWarner Losh	${_libsdp} \
979b3e440bSWarner Losh	${_libsm} \
9891ee3463SIan Lepore	libsmb \
999b3e440bSWarner Losh	${_libsmdb} \
1009b3e440bSWarner Losh	${_libsmutil} \
101362492e5SBaptiste Daroussin	libsqlite3 \
1029b3e440bSWarner Losh	libstand \
1036486b015SJeremie Le Hen	libstdbuf \
104fc6f0665SEd Schouten	libstdthreads \
105d6fb4894SJohn Baldwin	libsysdecode \
106a1c70d69SIan Lepore	libtacplus \
1079b3e440bSWarner Losh	${_libtelnet} \
1089b3e440bSWarner Losh	${_libthr} \
1099b3e440bSWarner Losh	libthread_db \
1104ca4d6a8SBaptiste Daroussin	libucl \
1119b3e440bSWarner Losh	libufs \
1129b3e440bSWarner Losh	libugidfw \
1139b3e440bSWarner Losh	libulog \
1148f8790cdSDag-Erling Smørgrav	${_libunbound} \
1159b3e440bSWarner Losh	${_libusbhid} \
1169b3e440bSWarner Losh	${_libusb} \
117a1c70d69SIan Lepore	libutil \
1189b3e440bSWarner Losh	${_libvgl} \
119366f6083SPeter Grehan	${_libvmmapi} \
1209b3e440bSWarner Losh	libwrap \
121d7790611SMarcel Moolenaar	libxo \
1229b3e440bSWarner Losh	liby \
123a1c70d69SIan Lepore	${_libypclnt} \
1249b3e440bSWarner Losh	libz \
125a1c70d69SIan Lepore	ncurses \
126c175365cSMarcel Moolenaar	${_atf} \
127cc21b86fSJulio Merino	${_clang} \
12836716419SHans Petter Selasky	${_cuse} \
129cc21b86fSJulio Merino	${_tests}
13058f0484fSRodney W. Grimes
131a1c70d69SIan Lepore# Inter-library dependencies.  When the makefile for a library contains LDADD
132a1c70d69SIan Lepore# libraries, those libraries should be listed as build order dependencies here.
133a1c70d69SIan Lepore
134a1c70d69SIan LeporeSUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
135a1c70d69SIan LeporeSUBDIR_DEPEND_libatm= libmd
136a1c70d69SIan LeporeSUBDIR_DEPEND_libauditdm= libbsm
137a1c70d69SIan LeporeSUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
138468a365dSBryan DrewerySUBDIR_DEPEND_libc++:= libcxxrt
139a1c70d69SIan LeporeSUBDIR_DEPEND_libc= libcompiler_rt
140a1c70d69SIan LeporeSUBDIR_DEPEND_libcam= libsbuf
141c501d73cSMariusz ZaborskiSUBDIR_DEPEND_libcasper= libnv
142a1c70d69SIan LeporeSUBDIR_DEPEND_libdevstat= libkvm
1437fc89952SDevin TeskeSUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
144a1c70d69SIan LeporeSUBDIR_DEPEND_libedit= ncurses
145a1c70d69SIan LeporeSUBDIR_DEPEND_libgeom= libexpat libsbuf
146a1c70d69SIan LeporeSUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
147a1c70d69SIan LeporeSUBDIR_DEPEND_libmagic= libz
148a1c70d69SIan LeporeSUBDIR_DEPEND_libmemstat= libkvm
149a1c70d69SIan LeporeSUBDIR_DEPEND_libopie= libmd
15031a741f4SEnji CooperSUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
151a1c70d69SIan LeporeSUBDIR_DEPEND_libpjdlog= libutil
152a1c70d69SIan LeporeSUBDIR_DEPEND_libprocstat= libkvm libutil
153a1c70d69SIan LeporeSUBDIR_DEPEND_libradius= libmd
154a1c70d69SIan LeporeSUBDIR_DEPEND_libsmb= libkiconv
155b626f5a7SGlen BarberSUBDIR_DEPEND_libtacplus= libmd
156a1c70d69SIan LeporeSUBDIR_DEPEND_libulog= libmd
157a1c70d69SIan LeporeSUBDIR_DEPEND_libunbound= ${_libldns}
15853200025SRui PauloSUBDIR_DEPEND_liblzma= ${_libthr}
159a1c70d69SIan Lepore
160690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
161690f477dSSam Leffler
162e1fe3dbaSRuslan Ermilov.if ${MK_ATM} != "no"
1639e9dbe04SHartmut Brandt_libngatm=	libngatm
1645e1847b4SPoul-Henning Kamp.endif
1655e1847b4SPoul-Henning Kamp
166c0759dacSKurt Lidl.if ${MK_BLACKLIST} != "no"
16795856e14SKurt Lidl_libblacklist=	libblacklist
16895856e14SKurt Lidl.endif
16995856e14SKurt Lidl
170e1fe3dbaSRuslan Ermilov.if ${MK_BLUETOOTH} != "no"
1710986ab12SMaksim Yevmenkin_libbluetooth=	libbluetooth
1720986ab12SMaksim Yevmenkin_libsdp=	libsdp
17318d948adSMaksim Yevmenkin.endif
17423d1e148SMaksim Yevmenkin
175690f477dSSam Leffler.if ${MK_BSNMP} != "no"
176690f477dSSam Leffler_libbsnmp=	libbsnmp
177690f477dSSam Leffler.endif
178690f477dSSam Leffler
17942a85952SPawel Jakub Dawidek.if ${MK_CASPER} != "no"
18042a85952SPawel Jakub Dawidek_libcasper=	libcasper
18142a85952SPawel Jakub Dawidek.endif
18242a85952SPawel Jakub Dawidek
183bb52d711SWarner Losh.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
1846513cfc8SRoman Divacky_clang=		clang
1856513cfc8SRoman Divacky.endif
1866513cfc8SRoman Divacky
18736716419SHans Petter Selasky.if ${MK_CUSE} != "no"
18836716419SHans Petter Selasky_cuse=		libcuse
18936716419SHans Petter Selasky.endif
19036716419SHans Petter Selasky
191903b0dd7SEd Maste.if ${MK_CXX} != "no"
192903b0dd7SEd Maste_libdevdctl=	libdevdctl
193903b0dd7SEd Maste.endif
194903b0dd7SEd Maste
1951bc28ffcSEd Maste.if ${MK_TOOLCHAIN} != "no"
19631942939SEd Maste_libelftc=	libelftc
197c1da2974SEd Maste_libpe=		libpe
19831942939SEd Maste.endif
19931942939SEd Maste
200c7b6816fSEnji Cooper.if ${MK_FILE} != "no"
201c7b6816fSEnji Cooper_libmagic=	libmagic
202c7b6816fSEnji Cooper.endif
203c7b6816fSEnji Cooper
2043b09bf5eSEnji Cooper.if ${MK_GPIO} != "no"
2053b09bf5eSEnji Cooper_libgpio=	libgpio
2063b09bf5eSEnji Cooper.endif
2073b09bf5eSEnji Cooper
2086dc51ecaSRuslan Ermilov.if ${MK_GSSAPI} != "no"
2093fe21f77SDoug Barton_libgssapi=	libgssapi
2108f55a568SDoug Rabson_librpcsec_gss=	librpcsec_gss
2113fe21f77SDoug Barton.endif
2123fe21f77SDoug Barton
213ad30f8e7SGabor Kovesdan.if ${MK_ICONV} != "no"
214ad30f8e7SGabor Kovesdan_libiconv_modules=	libiconv_modules
215ad30f8e7SGabor Kovesdan.endif
216ad30f8e7SGabor Kovesdan
217a1c70d69SIan Lepore.if ${MK_KERBEROS_SUPPORT} != "no"
218a1c70d69SIan Lepore_libcom_err= libcom_err
219a1c70d69SIan Lepore.endif
220a1c70d69SIan Lepore
2217b5038d7SDag-Erling Smørgrav.if ${MK_LDNS} != "no"
2227b5038d7SDag-Erling Smørgrav_libldns=	libldns
2237b5038d7SDag-Erling Smørgrav.endif
2247b5038d7SDag-Erling Smørgrav
2258028b78dSDimitry Andric# The libraries under libclang_rt can only be built by clang, and only make
2268028b78dSDimitry Andric# sense to build when clang is enabled at all.  Furthermore, they can only be
2278028b78dSDimitry Andric# built for certain architectures.
2288028b78dSDimitry Andric.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
229b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
230b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
231b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "i386"))
2328028b78dSDimitry Andric_libclang_rt=	libclang_rt
2338028b78dSDimitry Andric.endif
2348028b78dSDimitry Andric
23535e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
23635e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
23735e370a2SDag-Erling Smørgrav_libcplusplus=	libc++
23835e370a2SDag-Erling Smørgrav.endif
23935e370a2SDag-Erling Smørgrav
240690f477dSSam Leffler.if ${MK_LIBTHR} != "no"
241690f477dSSam Leffler_libthr=	libthr
242690f477dSSam Leffler.endif
243690f477dSSam Leffler
2447f725bcdSGrzegorz Bernacki.if ${MK_NAND} != "no"
2457f725bcdSGrzegorz Bernacki_libnandfs=	libnandfs
2467f725bcdSGrzegorz Bernacki.endif
2477f725bcdSGrzegorz Bernacki
248690f477dSSam Leffler.if ${MK_NETGRAPH} != "no"
249690f477dSSam Leffler_libnetgraph=	libnetgraph
250690f477dSSam Leffler.endif
251690f477dSSam Leffler
252690f477dSSam Leffler.if ${MK_NIS} != "no"
253690f477dSSam Leffler_libypclnt=	libypclnt
254690f477dSSam Leffler.endif
255690f477dSSam Leffler
25625faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
257c9811e98SBruce Evans_libvgl=	libvgl
25854bb94d7SRui Paulo_libproc=	libproc
259fb05b666SRui Paulo_librtld_db=	librtld_db
260abbb0b30SMarcel Moolenaar.endif
261abbb0b30SMarcel Moolenaar
26270d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
26302629e46SEnji Cooper.if ${MK_BHYVE} != "no"
26470d8f36aSPeter Grehan_libvmmapi=	libvmmapi
26570d8f36aSPeter Grehan.endif
26602629e46SEnji Cooper.endif
26770d8f36aSPeter Grehan
26807d39325SOleksandr Tymoshenko.if ${MACHINE_CPUARCH} == "mips"
26907d39325SOleksandr Tymoshenko_libproc=	libproc
27007d39325SOleksandr Tymoshenko_librtld_db=	librtld_db
27107d39325SOleksandr Tymoshenko.endif
27207d39325SOleksandr Tymoshenko
273c7570492SJustin Hibbits.if ${MACHINE_CPUARCH} == "powerpc"
274c7570492SJustin Hibbits_libproc=	libproc
275c7570492SJustin Hibbits_librtld_db=	librtld_db
276c7570492SJustin Hibbits.endif
277c7570492SJustin Hibbits
2785ac86464SRuslan Bukin.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
2795ac86464SRuslan Bukin    ${MACHINE_CPUARCH} == "riscv"
280fcb56067SGeorge V. Neville-Neil_libproc=	libproc
281fcb56067SGeorge V. Neville-Neil_librtld_db=	librtld_db
282fcb56067SGeorge V. Neville-Neil.endif
283fcb56067SGeorge V. Neville-Neil
284690f477dSSam Leffler.if ${MK_OPENSSL} != "no"
285690f477dSSam Leffler_libmp=		libmp
286690f477dSSam Leffler.endif
287690f477dSSam Leffler
288690f477dSSam Leffler.if ${MK_PMC} != "no"
289690f477dSSam Leffler_libpmc=	libpmc
290690f477dSSam Leffler.endif
291690f477dSSam Leffler
29231a741f4SEnji Cooper.if ${MK_RADIUS_SUPPORT} != "no"
29331a741f4SEnji Cooper_libradius=	libradius
29431a741f4SEnji Cooper.endif
29531a741f4SEnji Cooper
296690f477dSSam Leffler.if ${MK_SENDMAIL} != "no"
297690f477dSSam Leffler_libmilter=	libmilter
298690f477dSSam Leffler_libsm=		libsm
299690f477dSSam Leffler_libsmdb=	libsmdb
300690f477dSSam Leffler_libsmutil=	libsmutil
301690f477dSSam Leffler.endif
302690f477dSSam Leffler
303690f477dSSam Leffler.if ${MK_TELNET} != "no"
304690f477dSSam Leffler_libtelnet=	libtelnet
305e9043a12SMike Makonnen.endif
306e9043a12SMike Makonnen
307b55e8e6eSWarner Losh.if ${MK_TESTS_SUPPORT} != "no"
308e01d128aSJulio Merino_atf=		atf
309b55e8e6eSWarner Losh.endif
310b55e8e6eSWarner Losh.if ${MK_TESTS} != "no"
311cc21b86fSJulio Merino_tests=		tests
312e01d128aSJulio Merino.endif
313e01d128aSJulio Merino
3148f8790cdSDag-Erling Smørgrav.if ${MK_UNBOUND} != "no"
3158f8790cdSDag-Erling Smørgrav_libunbound=	libunbound
3168f8790cdSDag-Erling Smørgrav.endif
3178f8790cdSDag-Erling Smørgrav
318e1fe3dbaSRuslan Ermilov.if ${MK_USB} != "no"
319f3e5ff40SBruce Evans_libusbhid=	libusbhid
3206df55934SAndrew Thompson_libusb=	libusb
321a8ec1b48SMaxim Sobolev.endif
322a8ec1b48SMaxim Sobolev
32354ff5d73SDimitry Andric.if !make(install)
32454ff5d73SDimitry AndricSUBDIR_PARALLEL=
32554ff5d73SDimitry Andric.endif
32654ff5d73SDimitry Andric
32758f0484fSRodney W. Grimes.include <bsd.subdir.mk>
328