xref: /freebsd/lib/Makefile (revision 36716419f306eb946fafb57e3ab70246e38954b2)
158f0484fSRodney W. Grimes#	@(#)Makefile	8.1 (Berkeley) 6/4/93
27f3dea24SPeter Wemm# $FreeBSD$
3c9811e98SBruce Evans
4c6063d0dSWarner Losh.include <src.opts.mk>
5e1fe3dbaSRuslan Ermilov
6c9811e98SBruce Evans# To satisfy shared library or ELF linkage when only the libraries being
7c9811e98SBruce Evans# built are visible:
8c9811e98SBruce Evans#
90f09aefaSBruce Evans# csu must be built before all shared libaries for ELF.
104064334fSRuslan Ermilov# libc must be built before all other shared libraries.
11719728bfSRobert Watson# libbsm must be built before libauditd.
12eae951c9SWarner Losh# libcom_err must be built before libpam.
13eae951c9SWarner Losh# libcrypt must be built before libpam.
14c4a5ef6eSThomas Moestl# libkvm must be built before libdevstat.
158f8790cdSDag-Erling Smørgrav# libldns must be built before libunbound.
16a04f2acdSJosef Karthauser# msun must be built before libg++ and libstdc++.
17ccdee0d9SMark Murray# libmd must be built before libatm, libopie, libradius, and libtacplus.
18af5b5a0fSRong-En Fan# ncurses must be built before libdialog, libedit and libreadline.
19360b288fSHartmut Brandt# libnetgraph must be built before libbsnmp/modules/snmp_netgraph.
2014b42810SKris Kennaway# libopie must be built before libpam.
2160da54eeSJohn Polstra# libradius must be built before libpam.
2276ed168aSMark Murray# librpcsvc must be built before libpam.
2397b877c9SDag-Erling Smørgrav# libsbuf must be built before libcam.
2460da54eeSJohn Polstra# libtacplus must be built before libpam.
25c5da4b13SBruce Evans# libutil must be built before libpam.
2697b877c9SDag-Erling Smørgrav# libypclnt must be built before libpam.
278f55a568SDoug Rabson# libgssapi must be built before librpcsec_gss
28c9811e98SBruce Evans#
29c9811e98SBruce Evans# Otherwise, the SUBDIR list should be in alphabetical order.
30eae951c9SWarner Losh#
31eae951c9SWarner Losh# Except it appears bind needs to be compiled last
32c9811e98SBruce Evans
339b3e440bSWarner LoshSUBDIR_ORDERED=	${_csu} \
34b8fffe16SWarner Losh	.WAIT \
359b3e440bSWarner Losh	libc \
36091b8336SPeter Wemm	libc_nonshared \
37b8fffe16SWarner Losh	.WAIT \
38b8fffe16SWarner Losh	msun \
39b8fffe16SWarner Losh	.WAIT \
409b3e440bSWarner Losh	libbsm \
419b3e440bSWarner Losh	libauditd \
422f02600aSPawel Jakub Dawidek	libutil \
432f02600aSPawel Jakub Dawidek	libpjdlog \
4442a85952SPawel Jakub Dawidek	libnv \
4542a85952SPawel Jakub Dawidek	${_libcapsicum} \
4639cd938cSEd Schouten	libcompiler_rt \
479b3e440bSWarner Losh	libcrypt \
489b3e440bSWarner Losh	libelf \
49ad30f8e7SGabor Kovesdan	${_libiconv_modules} \
509b3e440bSWarner Losh	libkvm \
5171b5e1bbSDag-Erling Smørgrav	${_libldns} \
529b3e440bSWarner Losh	libmd \
539b3e440bSWarner Losh	ncurses \
549b3e440bSWarner Losh	${_libnetgraph} \
559b3e440bSWarner Losh	libradius \
569b3e440bSWarner Losh	librpcsvc \
579b3e440bSWarner Losh	libsbuf \
589b3e440bSWarner Losh	libtacplus \
5949c8e5e7SDimitry Andric	${_libypclnt} \
6049c8e5e7SDimitry Andric	${_libcxxrt} \
6149c8e5e7SDimitry Andric	${_libcplusplus}
629b3e440bSWarner Losh
630e46933cSStanislav Sedov.if ${MK_KERBEROS_SUPPORT} != "no"
640e46933cSStanislav SedovSUBDIR_ORDERED+=	libcom_err
650e46933cSStanislav Sedov.endif
660e46933cSStanislav Sedov
679b3e440bSWarner LoshSUBDIR=	${SUBDIR_ORDERED} \
68b8fffe16SWarner Losh	.WAIT \
699b3e440bSWarner Losh	libalias \
709b3e440bSWarner Losh	libarchive \
719b3e440bSWarner Losh	${_libatm} \
729b3e440bSWarner Losh	libbegemot \
7339cd938cSEd Schouten	libblocksruntime \
749b3e440bSWarner Losh	${_libbluetooth} \
759b3e440bSWarner Losh	${_libbsnmp} \
7681bd3d89SAdrian Chadd	libbsdstat \
779b3e440bSWarner Losh	libbz2 \
789b3e440bSWarner Losh	libcalendar \
799b3e440bSWarner Losh	libcam \
8042a85952SPawel Jakub Dawidek	${_libcasper} \
819b3e440bSWarner Losh	libcompat \
829b3e440bSWarner Losh	libdevinfo \
839b3e440bSWarner Losh	libdevstat \
849b3e440bSWarner Losh	libdwarf \
859b3e440bSWarner Losh	libedit \
869b3e440bSWarner Losh	${_libefi} \
874b1fb8ffSEd Maste	libexecinfo \
889b3e440bSWarner Losh	libexpat \
899b3e440bSWarner Losh	libfetch \
909b3e440bSWarner Losh	libgeom \
919b3e440bSWarner Losh	${_libgpib} \
929b3e440bSWarner Losh	${_libgssapi} \
939b3e440bSWarner Losh	${_librpcsec_gss} \
949b3e440bSWarner Losh	libipsec \
959b3e440bSWarner Losh	libjail \
969b3e440bSWarner Losh	libkiconv \
9781ad8388SMartin Matuska	liblzma \
989b3e440bSWarner Losh	libmagic \
99cc4842a1SUlrich Spörlein	libmandoc \
1009b3e440bSWarner Losh	libmemstat \
1019b3e440bSWarner Losh	${_libmilter} \
1029b3e440bSWarner Losh	${_libmp} \
1037f725bcdSGrzegorz Bernacki	${_libnandfs} \
1046bea8766SBrooks Davis	libnetbsd \
1059b3e440bSWarner Losh	${_libngatm} \
1069b3e440bSWarner Losh	libopie \
1079b3e440bSWarner Losh	libpam \
1089b3e440bSWarner Losh	libpcap \
1099b3e440bSWarner Losh	${_libpmc} \
11054bb94d7SRui Paulo	${_libproc} \
1110daf62d9SStanislav Sedov	libprocstat \
1129b3e440bSWarner Losh	librt \
113fb05b666SRui Paulo	${_librtld_db} \
1149b3e440bSWarner Losh	${_libsdp} \
1159b3e440bSWarner Losh	${_libsm} \
116237abf0cSDavide Italiano	${_libsmb} \
1179b3e440bSWarner Losh	${_libsmdb} \
1189b3e440bSWarner Losh	${_libsmutil} \
1199b3e440bSWarner Losh	libstand \
1206486b015SJeremie Le Hen	libstdbuf \
121fc6f0665SEd Schouten	libstdthreads \
1229b3e440bSWarner Losh	${_libtelnet} \
1239b3e440bSWarner Losh	${_libthr} \
1249b3e440bSWarner Losh	libthread_db \
1254ca4d6a8SBaptiste Daroussin	libucl \
1269b3e440bSWarner Losh	libufs \
1279b3e440bSWarner Losh	libugidfw \
1289b3e440bSWarner Losh	libulog \
1298f8790cdSDag-Erling Smørgrav	${_libunbound} \
1309b3e440bSWarner Losh	${_libusbhid} \
1319b3e440bSWarner Losh	${_libusb} \
1329b3e440bSWarner Losh	${_libvgl} \
133366f6083SPeter Grehan	${_libvmmapi} \
1349b3e440bSWarner Losh	libwrap \
1359b3e440bSWarner Losh	liby \
1369b3e440bSWarner Losh	libz \
137c175365cSMarcel Moolenaar	${_atf} \
138cc21b86fSJulio Merino	${_clang} \
139*36716419SHans Petter Selasky	${_cuse} \
140cc21b86fSJulio Merino	${_tests}
14158f0484fSRodney W. Grimes
1422bef81cfSWarner Losh.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
1432bef81cfSWarner Losh_csu=csu/${MACHINE_ARCH}-elf
144b12277d1SNathan Whitehorn.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
145b12277d1SNathan Whitehorn_csu=csu/${MACHINE_ARCH}
14625faff34SWarner Losh.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
14725faff34SWarner Losh_csu=csu/${MACHINE_CPUARCH}
14856a91a6fSDavid E. O'Brien.else
14956a91a6fSDavid E. O'Brien_csu=csu
150b09f41a4SJohn Birrell.endif
151b09f41a4SJohn Birrell
152690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
153690f477dSSam Leffler
154e1fe3dbaSRuslan Ermilov.if ${MK_ATM} != "no"
1559e9dbe04SHartmut Brandt_libngatm=	libngatm
1565e1847b4SPoul-Henning Kamp.endif
1575e1847b4SPoul-Henning Kamp
158e1fe3dbaSRuslan Ermilov.if ${MK_BLUETOOTH} != "no"
1590986ab12SMaksim Yevmenkin_libbluetooth=	libbluetooth
1600986ab12SMaksim Yevmenkin_libsdp=	libsdp
16118d948adSMaksim Yevmenkin.endif
16223d1e148SMaksim Yevmenkin
163690f477dSSam Leffler.if ${MK_BSNMP} != "no"
164690f477dSSam Leffler_libbsnmp=	libbsnmp
165690f477dSSam Leffler.endif
166690f477dSSam Leffler
16742a85952SPawel Jakub Dawidek.if ${MK_CASPER} != "no"
16842a85952SPawel Jakub Dawidek_libcapsicum=	libcapsicum
16942a85952SPawel Jakub Dawidek_libcasper=	libcasper
17042a85952SPawel Jakub Dawidek.endif
17142a85952SPawel Jakub Dawidek
172bfc72ed5SEd Schouten.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
1736513cfc8SRoman Divacky_clang=		clang
1746513cfc8SRoman Divacky.endif
1756513cfc8SRoman Divacky
176*36716419SHans Petter Selasky.if ${MK_CUSE} != "no"
177*36716419SHans Petter Selasky_cuse=		libcuse
178*36716419SHans Petter Selasky.endif
179*36716419SHans Petter Selasky
180690f477dSSam Leffler.if ${MK_GPIB} != "no"
181690f477dSSam Leffler_libgpib=	libgpib
182690f477dSSam Leffler.endif
183690f477dSSam Leffler
1846dc51ecaSRuslan Ermilov.if ${MK_GSSAPI} != "no"
1853fe21f77SDoug Barton_libgssapi=	libgssapi
1868f55a568SDoug Rabson_librpcsec_gss=	librpcsec_gss
1873fe21f77SDoug Barton.endif
1883fe21f77SDoug Barton
189ad30f8e7SGabor Kovesdan.if ${MK_ICONV} != "no"
190ad30f8e7SGabor Kovesdan_libiconv_modules=	libiconv_modules
191ad30f8e7SGabor Kovesdan.endif
192ad30f8e7SGabor Kovesdan
1937b5038d7SDag-Erling Smørgrav.if ${MK_LDNS} != "no"
1947b5038d7SDag-Erling Smørgrav_libldns=	libldns
1957b5038d7SDag-Erling Smørgrav.endif
1967b5038d7SDag-Erling Smørgrav
19735e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
19835e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
19935e370a2SDag-Erling Smørgrav_libcplusplus=	libc++
20035e370a2SDag-Erling Smørgrav.endif
20135e370a2SDag-Erling Smørgrav
202690f477dSSam Leffler.if ${MK_LIBTHR} != "no"
203690f477dSSam Leffler_libthr=	libthr
204690f477dSSam Leffler.endif
205690f477dSSam Leffler
2067f725bcdSGrzegorz Bernacki.if ${MK_NAND} != "no"
2077f725bcdSGrzegorz Bernacki_libnandfs=	libnandfs
2087f725bcdSGrzegorz Bernacki.endif
2097f725bcdSGrzegorz Bernacki
210690f477dSSam Leffler.if ${MK_NETGRAPH} != "no"
211690f477dSSam Leffler_libnetgraph=	libnetgraph
212690f477dSSam Leffler.endif
213690f477dSSam Leffler
214690f477dSSam Leffler.if ${MK_NIS} != "no"
215690f477dSSam Leffler_libypclnt=	libypclnt
216690f477dSSam Leffler.endif
217690f477dSSam Leffler
21825faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
219237abf0cSDavide Italiano_libsmb=	libsmb
220c9811e98SBruce Evans_libvgl=	libvgl
22154bb94d7SRui Paulo_libproc=	libproc
222fb05b666SRui Paulo_librtld_db=	librtld_db
223abbb0b30SMarcel Moolenaar.endif
224abbb0b30SMarcel Moolenaar
22570d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
22670d8f36aSPeter Grehan_libvmmapi=	libvmmapi
22770d8f36aSPeter Grehan.endif
22870d8f36aSPeter Grehan
22925faff34SWarner Losh.if ${MACHINE_CPUARCH} == "ia64"
230eb0a7e41SMarcel Moolenaar_libefi=	libefi
231237abf0cSDavide Italiano_libsmb=	libsmb
232e108ac65SMarcel Moolenaar.endif
233e108ac65SMarcel Moolenaar
23407d39325SOleksandr Tymoshenko.if ${MACHINE_CPUARCH} == "mips"
23507d39325SOleksandr Tymoshenko_libproc=	libproc
23607d39325SOleksandr Tymoshenko_librtld_db=	librtld_db
23707d39325SOleksandr Tymoshenko.endif
23807d39325SOleksandr Tymoshenko
239c7570492SJustin Hibbits.if ${MACHINE_CPUARCH} == "powerpc"
240c7570492SJustin Hibbits_libproc=	libproc
241c7570492SJustin Hibbits_librtld_db=	librtld_db
242237abf0cSDavide Italiano_libsmb=	libsmb
243237abf0cSDavide Italiano.endif
244237abf0cSDavide Italiano
245237abf0cSDavide Italiano.if ${MACHINE_CPUARCH} == "sparc64"
246237abf0cSDavide Italiano_libsmb=	libsmb
247c7570492SJustin Hibbits.endif
248c7570492SJustin Hibbits
249690f477dSSam Leffler.if ${MK_OPENSSL} != "no"
250690f477dSSam Leffler_libmp=		libmp
251690f477dSSam Leffler.endif
252690f477dSSam Leffler
253690f477dSSam Leffler.if ${MK_PMC} != "no"
254690f477dSSam Leffler_libpmc=	libpmc
255690f477dSSam Leffler.endif
256690f477dSSam Leffler
257690f477dSSam Leffler.if ${MK_SENDMAIL} != "no"
258690f477dSSam Leffler_libmilter=	libmilter
259690f477dSSam Leffler_libsm=		libsm
260690f477dSSam Leffler_libsmdb=	libsmdb
261690f477dSSam Leffler_libsmutil=	libsmutil
262690f477dSSam Leffler.endif
263690f477dSSam Leffler
264690f477dSSam Leffler.if ${MK_TELNET} != "no"
265690f477dSSam Leffler_libtelnet=	libtelnet
266e9043a12SMike Makonnen.endif
267e9043a12SMike Makonnen
268e01d128aSJulio Merino.if ${MK_TESTS} != "no"
269e01d128aSJulio Merino_atf=		atf
270cc21b86fSJulio Merino_tests=		tests
271e01d128aSJulio Merino.endif
272e01d128aSJulio Merino
2738f8790cdSDag-Erling Smørgrav.if ${MK_UNBOUND} != "no"
2748f8790cdSDag-Erling Smørgrav_libunbound=	libunbound
2758f8790cdSDag-Erling Smørgrav.endif
2768f8790cdSDag-Erling Smørgrav
277e1fe3dbaSRuslan Ermilov.if ${MK_USB} != "no"
278f3e5ff40SBruce Evans_libusbhid=	libusbhid
2796df55934SAndrew Thompson_libusb=	libusb
280a8ec1b48SMaxim Sobolev.endif
281a8ec1b48SMaxim Sobolev
2827be23620SBrooks Davis.if !defined(LIBRARIES_ONLY)
2837c83e443STim Kientzleafterinstall:
2847be23620SBrooks Davis	${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
2857be23620SBrooks Davis.endif
2867c83e443STim Kientzle
28754ff5d73SDimitry Andric.if !make(install)
28854ff5d73SDimitry AndricSUBDIR_PARALLEL=
28954ff5d73SDimitry Andric.endif
29054ff5d73SDimitry Andric
29158f0484fSRodney W. Grimes.include <bsd.subdir.mk>
292