xref: /freebsd/lib/Makefile (revision 7a6e3cf83ebd7d3a7611b26234d12a92bb0d463e)
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 \
41*7a6e3cf8SMariusz Zaborski	libcapsicum \
4242a85952SPawel Jakub Dawidek	${_libcasper} \
43a1c70d69SIan Lepore	${_libcom_err} \
449b3e440bSWarner Losh	libcompat \
45a1c70d69SIan Lepore	libcrypt \
4664de8019SJohn Baldwin	libdevctl \
47903b0dd7SEd Maste	${_libdevdctl} \
489b3e440bSWarner Losh	libdevinfo \
499b3e440bSWarner Losh	libdevstat \
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} \
63ec214349SKristof 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 \
9335c05a4fSAdrian Chadd	librss \
949b3e440bSWarner Losh	librt \
95fb05b666SRui Paulo	${_librtld_db} \
96a1c70d69SIan Lepore	libsbuf \
979b3e440bSWarner Losh	${_libsdp} \
989b3e440bSWarner Losh	${_libsm} \
9991ee3463SIan Lepore	libsmb \
1009b3e440bSWarner Losh	${_libsmdb} \
1019b3e440bSWarner Losh	${_libsmutil} \
102362492e5SBaptiste Daroussin	libsqlite3 \
1039b3e440bSWarner Losh	libstand \
1046486b015SJeremie Le Hen	libstdbuf \
105fc6f0665SEd Schouten	libstdthreads \
106d6fb4894SJohn Baldwin	libsysdecode \
107a1c70d69SIan Lepore	libtacplus \
1089b3e440bSWarner Losh	${_libtelnet} \
1099b3e440bSWarner Losh	${_libthr} \
1109b3e440bSWarner Losh	libthread_db \
1114ca4d6a8SBaptiste Daroussin	libucl \
1129b3e440bSWarner Losh	libufs \
1139b3e440bSWarner Losh	libugidfw \
1149b3e440bSWarner Losh	libulog \
1158f8790cdSDag-Erling Smørgrav	${_libunbound} \
1169b3e440bSWarner Losh	${_libusbhid} \
1179b3e440bSWarner Losh	${_libusb} \
118a1c70d69SIan Lepore	libutil \
1199b3e440bSWarner Losh	${_libvgl} \
120366f6083SPeter Grehan	${_libvmmapi} \
1219b3e440bSWarner Losh	libwrap \
122d7790611SMarcel Moolenaar	libxo \
1239b3e440bSWarner Losh	liby \
124a1c70d69SIan Lepore	${_libypclnt} \
1259b3e440bSWarner Losh	libz \
126a1c70d69SIan Lepore	ncurses \
127c175365cSMarcel Moolenaar	${_atf} \
128cc21b86fSJulio Merino	${_clang} \
12936716419SHans Petter Selasky	${_cuse} \
130cc21b86fSJulio Merino	${_tests}
13158f0484fSRodney W. Grimes
132a1c70d69SIan Lepore# Inter-library dependencies.  When the makefile for a library contains LDADD
133a1c70d69SIan Lepore# libraries, those libraries should be listed as build order dependencies here.
134a1c70d69SIan Lepore
135a1c70d69SIan LeporeSUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
136a1c70d69SIan LeporeSUBDIR_DEPEND_libatm= libmd
137a1c70d69SIan LeporeSUBDIR_DEPEND_libauditdm= libbsm
138a1c70d69SIan LeporeSUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
139468a365dSBryan DrewerySUBDIR_DEPEND_libc++:= libcxxrt
140a1c70d69SIan LeporeSUBDIR_DEPEND_libc= libcompiler_rt
141a1c70d69SIan LeporeSUBDIR_DEPEND_libcam= libsbuf
142c501d73cSMariusz ZaborskiSUBDIR_DEPEND_libcasper= libnv
143a1c70d69SIan LeporeSUBDIR_DEPEND_libdevstat= libkvm
1447fc89952SDevin TeskeSUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
145a1c70d69SIan LeporeSUBDIR_DEPEND_libedit= ncurses
146a1c70d69SIan LeporeSUBDIR_DEPEND_libgeom= libexpat libsbuf
147a1c70d69SIan LeporeSUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
148a1c70d69SIan LeporeSUBDIR_DEPEND_libmagic= libz
149a1c70d69SIan LeporeSUBDIR_DEPEND_libmemstat= libkvm
150a1c70d69SIan LeporeSUBDIR_DEPEND_libopie= libmd
15131a741f4SEnji CooperSUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
152a1c70d69SIan LeporeSUBDIR_DEPEND_libpjdlog= libutil
153a1c70d69SIan LeporeSUBDIR_DEPEND_libprocstat= libkvm libutil
154a1c70d69SIan LeporeSUBDIR_DEPEND_libradius= libmd
155a1c70d69SIan LeporeSUBDIR_DEPEND_libsmb= libkiconv
156b626f5a7SGlen BarberSUBDIR_DEPEND_libtacplus= libmd
157a1c70d69SIan LeporeSUBDIR_DEPEND_libulog= libmd
158a1c70d69SIan LeporeSUBDIR_DEPEND_libunbound= ${_libldns}
15953200025SRui PauloSUBDIR_DEPEND_liblzma= ${_libthr}
160a1c70d69SIan Lepore
161690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
162690f477dSSam Leffler
163e1fe3dbaSRuslan Ermilov.if ${MK_ATM} != "no"
1649e9dbe04SHartmut Brandt_libngatm=	libngatm
1655e1847b4SPoul-Henning Kamp.endif
1665e1847b4SPoul-Henning Kamp
167c0759dacSKurt Lidl.if ${MK_BLACKLIST} != "no"
16895856e14SKurt Lidl_libblacklist=	libblacklist
16995856e14SKurt Lidl.endif
17095856e14SKurt Lidl
171e1fe3dbaSRuslan Ermilov.if ${MK_BLUETOOTH} != "no"
1720986ab12SMaksim Yevmenkin_libbluetooth=	libbluetooth
1730986ab12SMaksim Yevmenkin_libsdp=	libsdp
17418d948adSMaksim Yevmenkin.endif
17523d1e148SMaksim Yevmenkin
176690f477dSSam Leffler.if ${MK_BSNMP} != "no"
177690f477dSSam Leffler_libbsnmp=	libbsnmp
178690f477dSSam Leffler.endif
179690f477dSSam Leffler
18042a85952SPawel Jakub Dawidek.if ${MK_CASPER} != "no"
18142a85952SPawel Jakub Dawidek_libcasper=	libcasper
18242a85952SPawel Jakub Dawidek.endif
18342a85952SPawel Jakub Dawidek
184bb52d711SWarner Losh.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP)
1856513cfc8SRoman Divacky_clang=		clang
1866513cfc8SRoman Divacky.endif
1876513cfc8SRoman Divacky
18836716419SHans Petter Selasky.if ${MK_CUSE} != "no"
18936716419SHans Petter Selasky_cuse=		libcuse
19036716419SHans Petter Selasky.endif
19136716419SHans Petter Selasky
192903b0dd7SEd Maste.if ${MK_CXX} != "no"
193903b0dd7SEd Maste_libdevdctl=	libdevdctl
194903b0dd7SEd Maste.endif
195903b0dd7SEd Maste
1961bc28ffcSEd Maste.if ${MK_TOOLCHAIN} != "no"
19731942939SEd Maste_libelftc=	libelftc
198c1da2974SEd Maste_libpe=		libpe
19931942939SEd Maste.endif
20031942939SEd Maste
201f987297fSEd MasteSUBDIR.${MK_DIALOG}+=	libdpv
202f987297fSEd Maste
203c7b6816fSEnji Cooper.if ${MK_FILE} != "no"
204c7b6816fSEnji Cooper_libmagic=	libmagic
205c7b6816fSEnji Cooper.endif
206c7b6816fSEnji Cooper
2073b09bf5eSEnji Cooper.if ${MK_GPIO} != "no"
2083b09bf5eSEnji Cooper_libgpio=	libgpio
2093b09bf5eSEnji Cooper.endif
2103b09bf5eSEnji Cooper
2116dc51ecaSRuslan Ermilov.if ${MK_GSSAPI} != "no"
2123fe21f77SDoug Barton_libgssapi=	libgssapi
2138f55a568SDoug Rabson_librpcsec_gss=	librpcsec_gss
2143fe21f77SDoug Barton.endif
2153fe21f77SDoug Barton
216ad30f8e7SGabor Kovesdan.if ${MK_ICONV} != "no"
217ad30f8e7SGabor Kovesdan_libiconv_modules=	libiconv_modules
218ad30f8e7SGabor Kovesdan.endif
219ad30f8e7SGabor Kovesdan
220a1c70d69SIan Lepore.if ${MK_KERBEROS_SUPPORT} != "no"
221a1c70d69SIan Lepore_libcom_err= libcom_err
222a1c70d69SIan Lepore.endif
223a1c70d69SIan Lepore
2247b5038d7SDag-Erling Smørgrav.if ${MK_LDNS} != "no"
2257b5038d7SDag-Erling Smørgrav_libldns=	libldns
2267b5038d7SDag-Erling Smørgrav.endif
2277b5038d7SDag-Erling Smørgrav
2288028b78dSDimitry Andric# The libraries under libclang_rt can only be built by clang, and only make
2298028b78dSDimitry Andric# sense to build when clang is enabled at all.  Furthermore, they can only be
2308028b78dSDimitry Andric# built for certain architectures.
2318028b78dSDimitry Andric.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
232b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
233b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
234b78ee15eSRuslan Bukin    (${MACHINE_CPUARCH} == "i386"))
2358028b78dSDimitry Andric_libclang_rt=	libclang_rt
2368028b78dSDimitry Andric.endif
2378028b78dSDimitry Andric
23835e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
23935e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
24035e370a2SDag-Erling Smørgrav_libcplusplus=	libc++
24135e370a2SDag-Erling Smørgrav.endif
24235e370a2SDag-Erling Smørgrav
243690f477dSSam Leffler.if ${MK_LIBTHR} != "no"
244690f477dSSam Leffler_libthr=	libthr
245690f477dSSam Leffler.endif
246690f477dSSam Leffler
2477f725bcdSGrzegorz Bernacki.if ${MK_NAND} != "no"
2487f725bcdSGrzegorz Bernacki_libnandfs=	libnandfs
2497f725bcdSGrzegorz Bernacki.endif
2507f725bcdSGrzegorz Bernacki
251690f477dSSam Leffler.if ${MK_NETGRAPH} != "no"
252690f477dSSam Leffler_libnetgraph=	libnetgraph
253690f477dSSam Leffler.endif
254690f477dSSam Leffler
255690f477dSSam Leffler.if ${MK_NIS} != "no"
256690f477dSSam Leffler_libypclnt=	libypclnt
257690f477dSSam Leffler.endif
258690f477dSSam Leffler
25925faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
260c9811e98SBruce Evans_libvgl=	libvgl
26154bb94d7SRui Paulo_libproc=	libproc
262fb05b666SRui Paulo_librtld_db=	librtld_db
263abbb0b30SMarcel Moolenaar.endif
264abbb0b30SMarcel Moolenaar
26570d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
26602629e46SEnji Cooper.if ${MK_BHYVE} != "no"
26770d8f36aSPeter Grehan_libvmmapi=	libvmmapi
26870d8f36aSPeter Grehan.endif
26902629e46SEnji Cooper.endif
27070d8f36aSPeter Grehan
27107d39325SOleksandr Tymoshenko.if ${MACHINE_CPUARCH} == "mips"
27207d39325SOleksandr Tymoshenko_libproc=	libproc
27307d39325SOleksandr Tymoshenko_librtld_db=	librtld_db
27407d39325SOleksandr Tymoshenko.endif
27507d39325SOleksandr Tymoshenko
276c7570492SJustin Hibbits.if ${MACHINE_CPUARCH} == "powerpc"
277c7570492SJustin Hibbits_libproc=	libproc
278c7570492SJustin Hibbits_librtld_db=	librtld_db
279c7570492SJustin Hibbits.endif
280c7570492SJustin Hibbits
2815ac86464SRuslan Bukin.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
2825ac86464SRuslan Bukin    ${MACHINE_CPUARCH} == "riscv"
283fcb56067SGeorge V. Neville-Neil_libproc=	libproc
284fcb56067SGeorge V. Neville-Neil_librtld_db=	librtld_db
285fcb56067SGeorge V. Neville-Neil.endif
286fcb56067SGeorge V. Neville-Neil
287690f477dSSam Leffler.if ${MK_OPENSSL} != "no"
288690f477dSSam Leffler_libmp=		libmp
289690f477dSSam Leffler.endif
290690f477dSSam Leffler
291690f477dSSam Leffler.if ${MK_PMC} != "no"
292690f477dSSam Leffler_libpmc=	libpmc
293690f477dSSam Leffler.endif
294690f477dSSam Leffler
29531a741f4SEnji Cooper.if ${MK_RADIUS_SUPPORT} != "no"
29631a741f4SEnji Cooper_libradius=	libradius
29731a741f4SEnji Cooper.endif
29831a741f4SEnji Cooper
299690f477dSSam Leffler.if ${MK_SENDMAIL} != "no"
300690f477dSSam Leffler_libmilter=	libmilter
301690f477dSSam Leffler_libsm=		libsm
302690f477dSSam Leffler_libsmdb=	libsmdb
303690f477dSSam Leffler_libsmutil=	libsmutil
304690f477dSSam Leffler.endif
305690f477dSSam Leffler
306690f477dSSam Leffler.if ${MK_TELNET} != "no"
307690f477dSSam Leffler_libtelnet=	libtelnet
308e9043a12SMike Makonnen.endif
309e9043a12SMike Makonnen
310b55e8e6eSWarner Losh.if ${MK_TESTS_SUPPORT} != "no"
311e01d128aSJulio Merino_atf=		atf
312b55e8e6eSWarner Losh.endif
313b55e8e6eSWarner Losh.if ${MK_TESTS} != "no"
314cc21b86fSJulio Merino_tests=		tests
315e01d128aSJulio Merino.endif
316e01d128aSJulio Merino
3178f8790cdSDag-Erling Smørgrav.if ${MK_UNBOUND} != "no"
3188f8790cdSDag-Erling Smørgrav_libunbound=	libunbound
3198f8790cdSDag-Erling Smørgrav.endif
3208f8790cdSDag-Erling Smørgrav
321e1fe3dbaSRuslan Ermilov.if ${MK_USB} != "no"
322f3e5ff40SBruce Evans_libusbhid=	libusbhid
3236df55934SAndrew Thompson_libusb=	libusb
324a8ec1b48SMaxim Sobolev.endif
325a8ec1b48SMaxim Sobolev
32654ff5d73SDimitry Andric.if !make(install)
32754ff5d73SDimitry AndricSUBDIR_PARALLEL=
32854ff5d73SDimitry Andric.endif
32954ff5d73SDimitry Andric
33058f0484fSRodney W. Grimes.include <bsd.subdir.mk>
331