xref: /freebsd/lib/Makefile (revision 3b09bf5e55207926e3072b96ffca3b551a26b613)
158f0484fSRodney W. Grimes#	@(#)Makefile	8.1 (Berkeley) 6/4/93
27f3dea24SPeter Wemm# $FreeBSD$
3c9811e98SBruce Evans
4c6063d0dSWarner Losh.include <src.opts.mk>
5e1fe3dbaSRuslan Ermilov
6a1c70d69SIan Lepore# The SUBDIR_ORDERED 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
119b3e440bSWarner LoshSUBDIR_ORDERED=	${_csu} \
12b8fffe16SWarner Losh	.WAIT \
139b3e440bSWarner Losh	libc \
14091b8336SPeter Wemm	libc_nonshared \
1539cd938cSEd Schouten	libcompiler_rt \
168028b78dSDimitry Andric	${_libclang_rt} \
17a1c70d69SIan Lepore	${_libcplusplus} \
1849c8e5e7SDimitry Andric	${_libcxxrt} \
19a1c70d69SIan Lepore	libelf \
20a1c70d69SIan Lepore	msun
219b3e440bSWarner Losh
22a1c70d69SIan Lepore# The main list; please keep these sorted alphabetically.
230e46933cSStanislav Sedov
249b3e440bSWarner LoshSUBDIR=	${SUBDIR_ORDERED} \
25b8fffe16SWarner Losh	.WAIT \
269b3e440bSWarner Losh	libalias \
279b3e440bSWarner Losh	libarchive \
289b3e440bSWarner Losh	${_libatm} \
29a1c70d69SIan Lepore	libauditd \
309b3e440bSWarner Losh	libbegemot \
3139cd938cSEd Schouten	libblocksruntime \
329b3e440bSWarner Losh	${_libbluetooth} \
339b3e440bSWarner Losh	${_libbsnmp} \
3481bd3d89SAdrian Chadd	libbsdstat \
35a1c70d69SIan Lepore	libbsm \
369b3e440bSWarner Losh	libbz2 \
379b3e440bSWarner Losh	libcalendar \
389b3e440bSWarner Losh	libcam \
39a1c70d69SIan Lepore	${_libcapsicum} \
4042a85952SPawel Jakub Dawidek	${_libcasper} \
41a1c70d69SIan Lepore	${_libcom_err} \
429b3e440bSWarner Losh	libcompat \
43a1c70d69SIan Lepore	libcrypt \
449b3e440bSWarner Losh	libdevinfo \
459b3e440bSWarner Losh	libdevstat \
467fc89952SDevin Teske	libdpv \
479b3e440bSWarner Losh	libdwarf \
489b3e440bSWarner Losh	libedit \
4931942939SEd Maste	${_libelftc} \
50f9721976SXin LI	${_libevent} \
514b1fb8ffSEd Maste	libexecinfo \
529b3e440bSWarner Losh	libexpat \
539b3e440bSWarner Losh	libfetch \
54041394f3SDevin Teske	libfigpar \
559b3e440bSWarner Losh	libgeom \
56*3b09bf5eSEnji Cooper	${_libgpio} \
579b3e440bSWarner Losh	${_libgssapi} \
589b3e440bSWarner Losh	${_librpcsec_gss} \
59a1c70d69SIan Lepore	${_libiconv_modules} \
609b3e440bSWarner Losh	libipsec \
619b3e440bSWarner Losh	libjail \
629b3e440bSWarner Losh	libkiconv \
63a1c70d69SIan Lepore	libkvm \
64a1c70d69SIan Lepore	${_libldns} \
6581ad8388SMartin Matuska	liblzma \
669b3e440bSWarner Losh	libmagic \
67cc4842a1SUlrich Spörlein	libmandoc \
689b3e440bSWarner Losh	libmemstat \
69a1c70d69SIan Lepore	libmd \
709b3e440bSWarner Losh	${_libmilter} \
719b3e440bSWarner Losh	${_libmp} \
727f725bcdSGrzegorz Bernacki	${_libnandfs} \
736bea8766SBrooks Davis	libnetbsd \
74a1c70d69SIan Lepore	${_libnetgraph} \
759b3e440bSWarner Losh	${_libngatm} \
76a1c70d69SIan Lepore	libnv \
77e806d508SBaptiste Daroussin	libohash \
789b3e440bSWarner Losh	libopie \
799b3e440bSWarner Losh	libpam \
809b3e440bSWarner Losh	libpcap \
81a1c70d69SIan Lepore	libpjdlog \
829b3e440bSWarner Losh	${_libpmc} \
8354bb94d7SRui Paulo	${_libproc} \
840daf62d9SStanislav Sedov	libprocstat \
85a1c70d69SIan Lepore	libradius \
86a1c70d69SIan Lepore	librpcsvc \
879b3e440bSWarner Losh	librt \
88fb05b666SRui Paulo	${_librtld_db} \
89a1c70d69SIan Lepore	libsbuf \
909b3e440bSWarner Losh	${_libsdp} \
919b3e440bSWarner Losh	${_libsm} \
92237abf0cSDavide Italiano	${_libsmb} \
939b3e440bSWarner Losh	${_libsmdb} \
949b3e440bSWarner Losh	${_libsmutil} \
95362492e5SBaptiste Daroussin	libsqlite3 \
969b3e440bSWarner Losh	libstand \
976486b015SJeremie Le Hen	libstdbuf \
98fc6f0665SEd Schouten	libstdthreads \
99a1c70d69SIan Lepore	libtacplus \
1009b3e440bSWarner Losh	${_libtelnet} \
1019b3e440bSWarner Losh	${_libthr} \
1029b3e440bSWarner Losh	libthread_db \
1034ca4d6a8SBaptiste Daroussin	libucl \
1049b3e440bSWarner Losh	libufs \
1059b3e440bSWarner Losh	libugidfw \
1069b3e440bSWarner Losh	libulog \
1078f8790cdSDag-Erling Smørgrav	${_libunbound} \
1089b3e440bSWarner Losh	${_libusbhid} \
1099b3e440bSWarner Losh	${_libusb} \
110a1c70d69SIan Lepore	libutil \
1119b3e440bSWarner Losh	${_libvgl} \
112366f6083SPeter Grehan	${_libvmmapi} \
1139b3e440bSWarner Losh	libwrap \
114d7790611SMarcel Moolenaar	libxo \
1159b3e440bSWarner Losh	liby \
116a1c70d69SIan Lepore	${_libypclnt} \
1179b3e440bSWarner Losh	libz \
118a1c70d69SIan Lepore	ncurses \
119c175365cSMarcel Moolenaar	${_atf} \
120cc21b86fSJulio Merino	${_clang} \
12136716419SHans Petter Selasky	${_cuse} \
122cc21b86fSJulio Merino	${_tests}
12358f0484fSRodney W. Grimes
124a1c70d69SIan Lepore# Inter-library dependencies.  When the makefile for a library contains LDADD
125a1c70d69SIan Lepore# libraries, those libraries should be listed as build order dependencies here.
126a1c70d69SIan Lepore
127a1c70d69SIan LeporeSUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd
128a1c70d69SIan LeporeSUBDIR_DEPEND_libatm= libmd
129a1c70d69SIan LeporeSUBDIR_DEPEND_libauditdm= libbsm
130a1c70d69SIan LeporeSUBDIR_DEPEND_libbsnmp= ${_libnetgraph}
131a1c70d69SIan LeporeSUBDIR_DEPEND_libc++= libcxxrt
132a1c70d69SIan LeporeSUBDIR_DEPEND_libc= libcompiler_rt
133a1c70d69SIan LeporeSUBDIR_DEPEND_libcam= libsbuf
134a1c70d69SIan LeporeSUBDIR_DEPEND_libcapsicum= libnv
135a1c70d69SIan LeporeSUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog
136a1c70d69SIan LeporeSUBDIR_DEPEND_libdevstat= libkvm
1377fc89952SDevin TeskeSUBDIR_DEPEND_libdpv= libfigpar ncurses libutil
138a1c70d69SIan LeporeSUBDIR_DEPEND_libedit= ncurses
139a1c70d69SIan LeporeSUBDIR_DEPEND_libg++= msun
140a1c70d69SIan LeporeSUBDIR_DEPEND_libgeom= libexpat libsbuf
141a1c70d69SIan LeporeSUBDIR_DEPEND_liblibrpcsec_gss= libgssapi
142a1c70d69SIan LeporeSUBDIR_DEPEND_libmagic= libz
143a1c70d69SIan LeporeSUBDIR_DEPEND_libmemstat= libkvm
144a1c70d69SIan LeporeSUBDIR_DEPEND_libopie= libmd
145a1c70d69SIan LeporeSUBDIR_DEPEND_libpam= libcrypt libopie libradius librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err}
146a1c70d69SIan LeporeSUBDIR_DEPEND_libpjdlog= libutil
147a1c70d69SIan LeporeSUBDIR_DEPEND_libprocstat= libkvm libutil
148a1c70d69SIan LeporeSUBDIR_DEPEND_libradius= libmd
149a1c70d69SIan LeporeSUBDIR_DEPEND_libreadline= ncurses
150a1c70d69SIan LeporeSUBDIR_DEPEND_libsmb= libkiconv
151a1c70d69SIan LeporeSUBDIR_DEPEND_libstdc++= msun
152a1c70d69SIan LeporeSUBDIR_DEPEND_libtacplus= libmd
153a1c70d69SIan LeporeSUBDIR_DEPEND_libulog= libmd
154a1c70d69SIan LeporeSUBDIR_DEPEND_libunbound= ${_libldns}
155a1c70d69SIan Lepore
1562bef81cfSWarner Losh.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
1572bef81cfSWarner Losh_csu=csu/${MACHINE_ARCH}-elf
158b12277d1SNathan Whitehorn.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
159b12277d1SNathan Whitehorn_csu=csu/${MACHINE_ARCH}
16025faff34SWarner Losh.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
16125faff34SWarner Losh_csu=csu/${MACHINE_CPUARCH}
16256a91a6fSDavid E. O'Brien.else
16356a91a6fSDavid E. O'Brien_csu=csu
164b09f41a4SJohn Birrell.endif
165b09f41a4SJohn Birrell
166690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
167690f477dSSam Leffler
168e1fe3dbaSRuslan Ermilov.if ${MK_ATM} != "no"
1699e9dbe04SHartmut Brandt_libngatm=	libngatm
1705e1847b4SPoul-Henning Kamp.endif
1715e1847b4SPoul-Henning Kamp
172e1fe3dbaSRuslan Ermilov.if ${MK_BLUETOOTH} != "no"
1730986ab12SMaksim Yevmenkin_libbluetooth=	libbluetooth
1740986ab12SMaksim Yevmenkin_libsdp=	libsdp
17518d948adSMaksim Yevmenkin.endif
17623d1e148SMaksim Yevmenkin
177690f477dSSam Leffler.if ${MK_BSNMP} != "no"
178690f477dSSam Leffler_libbsnmp=	libbsnmp
179690f477dSSam Leffler.endif
180690f477dSSam Leffler
18142a85952SPawel Jakub Dawidek.if ${MK_CASPER} != "no"
18242a85952SPawel Jakub Dawidek_libcapsicum=	libcapsicum
18342a85952SPawel Jakub Dawidek_libcasper=	libcasper
18442a85952SPawel Jakub Dawidek.endif
18542a85952SPawel Jakub Dawidek
186bfc72ed5SEd Schouten.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
1876513cfc8SRoman Divacky_clang=		clang
1886513cfc8SRoman Divacky.endif
1896513cfc8SRoman Divacky
19036716419SHans Petter Selasky.if ${MK_CUSE} != "no"
19136716419SHans Petter Selasky_cuse=		libcuse
19236716419SHans Petter Selasky.endif
19336716419SHans Petter Selasky
19431942939SEd Maste.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
19531942939SEd Maste_libelftc=	libelftc
19631942939SEd Maste.endif
19731942939SEd Maste
198*3b09bf5eSEnji Cooper.if ${MK_GPIO} != "no"
199*3b09bf5eSEnji Cooper_libgpio=	libgpio
200*3b09bf5eSEnji Cooper.endif
201*3b09bf5eSEnji Cooper
2026dc51ecaSRuslan Ermilov.if ${MK_GSSAPI} != "no"
2033fe21f77SDoug Barton_libgssapi=	libgssapi
2048f55a568SDoug Rabson_librpcsec_gss=	librpcsec_gss
2053fe21f77SDoug Barton.endif
2063fe21f77SDoug Barton
207ad30f8e7SGabor Kovesdan.if ${MK_ICONV} != "no"
208ad30f8e7SGabor Kovesdan_libiconv_modules=	libiconv_modules
209ad30f8e7SGabor Kovesdan.endif
210ad30f8e7SGabor Kovesdan
211a1c70d69SIan Lepore.if ${MK_KERBEROS_SUPPORT} != "no"
212a1c70d69SIan Lepore_libcom_err= libcom_err
213a1c70d69SIan Lepore.endif
214a1c70d69SIan Lepore
2157b5038d7SDag-Erling Smørgrav.if ${MK_LDNS} != "no"
2167b5038d7SDag-Erling Smørgrav_libldns=	libldns
2177b5038d7SDag-Erling Smørgrav.endif
2187b5038d7SDag-Erling Smørgrav
2198028b78dSDimitry Andric# The libraries under libclang_rt can only be built by clang, and only make
2208028b78dSDimitry Andric# sense to build when clang is enabled at all.  Furthermore, they can only be
2218028b78dSDimitry Andric# built for certain architectures.
2228028b78dSDimitry Andric.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
2238028b78dSDimitry Andric    (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
2248028b78dSDimitry Andric    (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb"))
2258028b78dSDimitry Andric_libclang_rt=	libclang_rt
2268028b78dSDimitry Andric.endif
2278028b78dSDimitry Andric
22835e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
22935e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
23035e370a2SDag-Erling Smørgrav_libcplusplus=	libc++
23135e370a2SDag-Erling Smørgrav.endif
23235e370a2SDag-Erling Smørgrav
233690f477dSSam Leffler.if ${MK_LIBTHR} != "no"
234690f477dSSam Leffler_libthr=	libthr
235690f477dSSam Leffler.endif
236690f477dSSam Leffler
2377f725bcdSGrzegorz Bernacki.if ${MK_NAND} != "no"
2387f725bcdSGrzegorz Bernacki_libnandfs=	libnandfs
2397f725bcdSGrzegorz Bernacki.endif
2407f725bcdSGrzegorz Bernacki
241690f477dSSam Leffler.if ${MK_NETGRAPH} != "no"
242690f477dSSam Leffler_libnetgraph=	libnetgraph
243690f477dSSam Leffler.endif
244690f477dSSam Leffler
245690f477dSSam Leffler.if ${MK_NIS} != "no"
246690f477dSSam Leffler_libypclnt=	libypclnt
247690f477dSSam Leffler.endif
248690f477dSSam Leffler
249f9721976SXin LI.if ${MK_PF} != "no"
250f9721976SXin LI_libevent=	libevent
251f9721976SXin LI.endif
252f9721976SXin LI
25325faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
254237abf0cSDavide Italiano_libsmb=	libsmb
255c9811e98SBruce Evans_libvgl=	libvgl
25654bb94d7SRui Paulo_libproc=	libproc
257fb05b666SRui Paulo_librtld_db=	librtld_db
258abbb0b30SMarcel Moolenaar.endif
259abbb0b30SMarcel Moolenaar
26070d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
26170d8f36aSPeter Grehan_libvmmapi=	libvmmapi
26270d8f36aSPeter Grehan.endif
26370d8f36aSPeter Grehan
26407d39325SOleksandr Tymoshenko.if ${MACHINE_CPUARCH} == "mips"
26507d39325SOleksandr Tymoshenko_libproc=	libproc
26607d39325SOleksandr Tymoshenko_librtld_db=	librtld_db
26707d39325SOleksandr Tymoshenko.endif
26807d39325SOleksandr Tymoshenko
269c7570492SJustin Hibbits.if ${MACHINE_CPUARCH} == "powerpc"
270c7570492SJustin Hibbits_libproc=	libproc
271c7570492SJustin Hibbits_librtld_db=	librtld_db
272237abf0cSDavide Italiano_libsmb=	libsmb
273237abf0cSDavide Italiano.endif
274237abf0cSDavide Italiano
275237abf0cSDavide Italiano.if ${MACHINE_CPUARCH} == "sparc64"
276237abf0cSDavide Italiano_libsmb=	libsmb
277c7570492SJustin Hibbits.endif
278c7570492SJustin Hibbits
279690f477dSSam Leffler.if ${MK_OPENSSL} != "no"
280690f477dSSam Leffler_libmp=		libmp
281690f477dSSam Leffler.endif
282690f477dSSam Leffler
283690f477dSSam Leffler.if ${MK_PMC} != "no"
284690f477dSSam Leffler_libpmc=	libpmc
285690f477dSSam Leffler.endif
286690f477dSSam Leffler
287690f477dSSam Leffler.if ${MK_SENDMAIL} != "no"
288690f477dSSam Leffler_libmilter=	libmilter
289690f477dSSam Leffler_libsm=		libsm
290690f477dSSam Leffler_libsmdb=	libsmdb
291690f477dSSam Leffler_libsmutil=	libsmutil
292690f477dSSam Leffler.endif
293690f477dSSam Leffler
294690f477dSSam Leffler.if ${MK_TELNET} != "no"
295690f477dSSam Leffler_libtelnet=	libtelnet
296e9043a12SMike Makonnen.endif
297e9043a12SMike Makonnen
298b55e8e6eSWarner Losh.if ${MK_TESTS_SUPPORT} != "no"
299e01d128aSJulio Merino_atf=		atf
300b55e8e6eSWarner Losh.endif
301b55e8e6eSWarner Losh.if ${MK_TESTS} != "no"
302cc21b86fSJulio Merino_tests=		tests
303e01d128aSJulio Merino.endif
304e01d128aSJulio Merino
3058f8790cdSDag-Erling Smørgrav.if ${MK_UNBOUND} != "no"
3068f8790cdSDag-Erling Smørgrav_libunbound=	libunbound
3078f8790cdSDag-Erling Smørgrav.endif
3088f8790cdSDag-Erling Smørgrav
309e1fe3dbaSRuslan Ermilov.if ${MK_USB} != "no"
310f3e5ff40SBruce Evans_libusbhid=	libusbhid
3116df55934SAndrew Thompson_libusb=	libusb
312a8ec1b48SMaxim Sobolev.endif
313a8ec1b48SMaxim Sobolev
3147be23620SBrooks Davis.if !defined(LIBRARIES_ONLY)
3157c83e443STim Kientzleafterinstall:
3167be23620SBrooks Davis	${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
3177be23620SBrooks Davis.endif
3187c83e443STim Kientzle
31954ff5d73SDimitry Andric.if !make(install)
32054ff5d73SDimitry AndricSUBDIR_PARALLEL=
32154ff5d73SDimitry Andric.endif
32254ff5d73SDimitry Andric
32358f0484fSRodney W. Grimes.include <bsd.subdir.mk>
324