xref: /freebsd/lib/Makefile (revision 42a859525652decb08bba47ffaceb769d394175e)
158f0484fSRodney W. Grimes#	@(#)Makefile	8.1 (Berkeley) 6/4/93
27f3dea24SPeter Wemm# $FreeBSD$
3c9811e98SBruce Evans
4e1fe3dbaSRuslan Ermilov.include <bsd.own.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} \
349b3e440bSWarner Losh	libc \
35091b8336SPeter Wemm	libc_nonshared \
369b3e440bSWarner Losh	libbsm \
379b3e440bSWarner Losh	libauditd \
382f02600aSPawel Jakub Dawidek	libutil \
392f02600aSPawel Jakub Dawidek	libpjdlog \
40*42a85952SPawel Jakub Dawidek	libnv \
41*42a85952SPawel Jakub Dawidek	${_libcapsicum} \
4239cd938cSEd Schouten	libcompiler_rt \
439b3e440bSWarner Losh	libcrypt \
449b3e440bSWarner Losh	libelf \
45ad30f8e7SGabor Kovesdan	${_libiconv_modules} \
469b3e440bSWarner Losh	libkvm \
4771b5e1bbSDag-Erling Smørgrav	${_libldns} \
489b3e440bSWarner Losh	msun \
499b3e440bSWarner Losh	libmd \
509b3e440bSWarner Losh	ncurses \
519b3e440bSWarner Losh	${_libnetgraph} \
529b3e440bSWarner Losh	libradius \
539b3e440bSWarner Losh	librpcsvc \
549b3e440bSWarner Losh	libsbuf \
559b3e440bSWarner Losh	libtacplus \
5649c8e5e7SDimitry Andric	${_libypclnt} \
5749c8e5e7SDimitry Andric	${_libcxxrt} \
5849c8e5e7SDimitry Andric	${_libcplusplus}
599b3e440bSWarner Losh
600e46933cSStanislav Sedov.if ${MK_KERBEROS_SUPPORT} != "no"
610e46933cSStanislav SedovSUBDIR_ORDERED+=	libcom_err
620e46933cSStanislav Sedov.endif
630e46933cSStanislav Sedov
649b3e440bSWarner LoshSUBDIR=	${SUBDIR_ORDERED} \
659b3e440bSWarner Losh	libalias \
669b3e440bSWarner Losh	libarchive \
679b3e440bSWarner Losh	${_libatm} \
689b3e440bSWarner Losh	libbegemot \
6939cd938cSEd Schouten	libblocksruntime \
709b3e440bSWarner Losh	${_libbluetooth} \
719b3e440bSWarner Losh	${_libbsnmp} \
729b3e440bSWarner Losh	libbz2 \
739b3e440bSWarner Losh	libcalendar \
749b3e440bSWarner Losh	libcam \
75*42a85952SPawel Jakub Dawidek	${_libcasper} \
769b3e440bSWarner Losh	libcompat \
779b3e440bSWarner Losh	libdevinfo \
789b3e440bSWarner Losh	libdevstat \
799b3e440bSWarner Losh	libdwarf \
809b3e440bSWarner Losh	libedit \
819b3e440bSWarner Losh	${_libefi} \
824b1fb8ffSEd Maste	libexecinfo \
839b3e440bSWarner Losh	libexpat \
849b3e440bSWarner Losh	libfetch \
859b3e440bSWarner Losh	libgeom \
869b3e440bSWarner Losh	${_libgpib} \
879b3e440bSWarner Losh	${_libgssapi} \
889b3e440bSWarner Losh	${_librpcsec_gss} \
899b3e440bSWarner Losh	libipsec \
909b3e440bSWarner Losh	${_libipx} \
919b3e440bSWarner Losh	libjail \
929b3e440bSWarner Losh	libkiconv \
9381ad8388SMartin Matuska	liblzma \
949b3e440bSWarner Losh	libmagic \
95cc4842a1SUlrich Spörlein	libmandoc \
969b3e440bSWarner Losh	libmemstat \
979b3e440bSWarner Losh	${_libmilter} \
989b3e440bSWarner Losh	${_libmp} \
997f725bcdSGrzegorz Bernacki	${_libnandfs} \
1006bea8766SBrooks Davis	libnetbsd \
1019b3e440bSWarner Losh	${_libngatm} \
10236da5199SPawel Jakub Dawidek	libnv \
1039b3e440bSWarner Losh	libopie \
1049b3e440bSWarner Losh	libpam \
1059b3e440bSWarner Losh	libpcap \
1069b3e440bSWarner Losh	${_libpmc} \
10754bb94d7SRui Paulo	${_libproc} \
1080daf62d9SStanislav Sedov	libprocstat \
1099b3e440bSWarner Losh	librt \
110fb05b666SRui Paulo	${_librtld_db} \
1119b3e440bSWarner Losh	${_libsdp} \
1129b3e440bSWarner Losh	${_libsm} \
113237abf0cSDavide Italiano	${_libsmb} \
1149b3e440bSWarner Losh	${_libsmdb} \
1159b3e440bSWarner Losh	${_libsmutil} \
1169b3e440bSWarner Losh	libstand \
1176486b015SJeremie Le Hen	libstdbuf \
118fc6f0665SEd Schouten	libstdthreads \
1199b3e440bSWarner Losh	${_libtelnet} \
1209b3e440bSWarner Losh	${_libthr} \
1219b3e440bSWarner Losh	libthread_db \
1229b3e440bSWarner Losh	libufs \
1239b3e440bSWarner Losh	libugidfw \
1249b3e440bSWarner Losh	libulog \
1258f8790cdSDag-Erling Smørgrav	${_libunbound} \
1269b3e440bSWarner Losh	${_libusbhid} \
1279b3e440bSWarner Losh	${_libusb} \
1289b3e440bSWarner Losh	${_libvgl} \
129366f6083SPeter Grehan	${_libvmmapi} \
1309b3e440bSWarner Losh	libwrap \
1319b3e440bSWarner Losh	liby \
132e51c53f3SBaptiste Daroussin	libyaml \
1339b3e440bSWarner Losh	libz \
134c175365cSMarcel Moolenaar	${_atf} \
135cc21b86fSJulio Merino	${_clang} \
136cc21b86fSJulio Merino	${_tests}
13758f0484fSRodney W. Grimes
1382bef81cfSWarner Losh.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
1392bef81cfSWarner Losh_csu=csu/${MACHINE_ARCH}-elf
140b12277d1SNathan Whitehorn.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
141b12277d1SNathan Whitehorn_csu=csu/${MACHINE_ARCH}
14225faff34SWarner Losh.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
14325faff34SWarner Losh_csu=csu/${MACHINE_CPUARCH}
14456a91a6fSDavid E. O'Brien.else
14556a91a6fSDavid E. O'Brien_csu=csu
146b09f41a4SJohn Birrell.endif
147b09f41a4SJohn Birrell
148690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
149690f477dSSam Leffler
150e1fe3dbaSRuslan Ermilov.if ${MK_ATM} != "no"
1519e9dbe04SHartmut Brandt_libngatm=	libngatm
1525e1847b4SPoul-Henning Kamp.endif
1535e1847b4SPoul-Henning Kamp
154e1fe3dbaSRuslan Ermilov.if ${MK_BLUETOOTH} != "no"
1550986ab12SMaksim Yevmenkin_libbluetooth=	libbluetooth
1560986ab12SMaksim Yevmenkin_libsdp=	libsdp
15718d948adSMaksim Yevmenkin.endif
15823d1e148SMaksim Yevmenkin
159690f477dSSam Leffler.if ${MK_BSNMP} != "no"
160690f477dSSam Leffler_libbsnmp=	libbsnmp
161690f477dSSam Leffler.endif
162690f477dSSam Leffler
163*42a85952SPawel Jakub Dawidek.if ${MK_CASPER} != "no"
164*42a85952SPawel Jakub Dawidek_libcapsicum=	libcapsicum
165*42a85952SPawel Jakub Dawidek_libcasper=	libcasper
166*42a85952SPawel Jakub Dawidek.endif
167*42a85952SPawel Jakub Dawidek
168bfc72ed5SEd Schouten.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
1696513cfc8SRoman Divacky_clang=		clang
1706513cfc8SRoman Divacky.endif
1716513cfc8SRoman Divacky
172690f477dSSam Leffler.if ${MK_GPIB} != "no"
173690f477dSSam Leffler_libgpib=	libgpib
174690f477dSSam Leffler.endif
175690f477dSSam Leffler
1766dc51ecaSRuslan Ermilov.if ${MK_GSSAPI} != "no"
1773fe21f77SDoug Barton_libgssapi=	libgssapi
1788f55a568SDoug Rabson_librpcsec_gss=	librpcsec_gss
1793fe21f77SDoug Barton.endif
1803fe21f77SDoug Barton
181ad30f8e7SGabor Kovesdan.if ${MK_ICONV} != "no"
182ad30f8e7SGabor Kovesdan_libiconv_modules=	libiconv_modules
183ad30f8e7SGabor Kovesdan.endif
184ad30f8e7SGabor Kovesdan
185cea557adSRuslan Ermilov.if ${MK_IPX} != "no"
186cea557adSRuslan Ermilov_libipx=	libipx
187cea557adSRuslan Ermilov.endif
188cea557adSRuslan Ermilov
1897b5038d7SDag-Erling Smørgrav.if ${MK_LDNS} != "no"
1907b5038d7SDag-Erling Smørgrav_libldns=	libldns
1917b5038d7SDag-Erling Smørgrav.endif
1927b5038d7SDag-Erling Smørgrav
19335e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
19435e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
19535e370a2SDag-Erling Smørgrav_libcplusplus=	libc++
19635e370a2SDag-Erling Smørgrav.endif
19735e370a2SDag-Erling Smørgrav
198690f477dSSam Leffler.if ${MK_LIBTHR} != "no"
199690f477dSSam Leffler_libthr=	libthr
200690f477dSSam Leffler.endif
201690f477dSSam Leffler
2027f725bcdSGrzegorz Bernacki.if ${MK_NAND} != "no"
2037f725bcdSGrzegorz Bernacki_libnandfs=	libnandfs
2047f725bcdSGrzegorz Bernacki.endif
2057f725bcdSGrzegorz Bernacki
206690f477dSSam Leffler.if ${MK_NETGRAPH} != "no"
207690f477dSSam Leffler_libnetgraph=	libnetgraph
208690f477dSSam Leffler.endif
209690f477dSSam Leffler
210690f477dSSam Leffler.if ${MK_NIS} != "no"
211690f477dSSam Leffler_libypclnt=	libypclnt
212690f477dSSam Leffler.endif
213690f477dSSam Leffler
21425faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
215237abf0cSDavide Italiano_libsmb=	libsmb
216c9811e98SBruce Evans_libvgl=	libvgl
21754bb94d7SRui Paulo_libproc=	libproc
218fb05b666SRui Paulo_librtld_db=	librtld_db
219abbb0b30SMarcel Moolenaar.endif
220abbb0b30SMarcel Moolenaar
22170d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
22270d8f36aSPeter Grehan_libvmmapi=	libvmmapi
22370d8f36aSPeter Grehan.endif
22470d8f36aSPeter Grehan
22525faff34SWarner Losh.if ${MACHINE_CPUARCH} == "ia64"
226eb0a7e41SMarcel Moolenaar_libefi=	libefi
227237abf0cSDavide Italiano_libsmb=	libsmb
228e108ac65SMarcel Moolenaar.endif
229e108ac65SMarcel Moolenaar
23007d39325SOleksandr Tymoshenko.if ${MACHINE_CPUARCH} == "mips"
23107d39325SOleksandr Tymoshenko_libproc=	libproc
23207d39325SOleksandr Tymoshenko_librtld_db=	librtld_db
23307d39325SOleksandr Tymoshenko.endif
23407d39325SOleksandr Tymoshenko
235c7570492SJustin Hibbits.if ${MACHINE_CPUARCH} == "powerpc"
236c7570492SJustin Hibbits_libproc=	libproc
237c7570492SJustin Hibbits_librtld_db=	librtld_db
238237abf0cSDavide Italiano_libsmb=	libsmb
239237abf0cSDavide Italiano.endif
240237abf0cSDavide Italiano
241237abf0cSDavide Italiano.if ${MACHINE_CPUARCH} == "sparc64"
242237abf0cSDavide Italiano_libsmb=	libsmb
243c7570492SJustin Hibbits.endif
244c7570492SJustin Hibbits
245690f477dSSam Leffler.if ${MK_OPENSSL} != "no"
246690f477dSSam Leffler_libmp=		libmp
247690f477dSSam Leffler.endif
248690f477dSSam Leffler
249690f477dSSam Leffler.if ${MK_PMC} != "no"
250690f477dSSam Leffler_libpmc=	libpmc
251690f477dSSam Leffler.endif
252690f477dSSam Leffler
253690f477dSSam Leffler.if ${MK_SENDMAIL} != "no"
254690f477dSSam Leffler_libmilter=	libmilter
255690f477dSSam Leffler_libsm=		libsm
256690f477dSSam Leffler_libsmdb=	libsmdb
257690f477dSSam Leffler_libsmutil=	libsmutil
258690f477dSSam Leffler.endif
259690f477dSSam Leffler
260690f477dSSam Leffler.if ${MK_TELNET} != "no"
261690f477dSSam Leffler_libtelnet=	libtelnet
262e9043a12SMike Makonnen.endif
263e9043a12SMike Makonnen
264e01d128aSJulio Merino.if ${MK_TESTS} != "no"
265e01d128aSJulio Merino_atf=		atf
266cc21b86fSJulio Merino_tests=		tests
267e01d128aSJulio Merino.endif
268e01d128aSJulio Merino
2698f8790cdSDag-Erling Smørgrav.if ${MK_UNBOUND} != "no"
2708f8790cdSDag-Erling Smørgrav_libunbound=	libunbound
2718f8790cdSDag-Erling Smørgrav.endif
2728f8790cdSDag-Erling Smørgrav
273e1fe3dbaSRuslan Ermilov.if ${MK_USB} != "no"
274f3e5ff40SBruce Evans_libusbhid=	libusbhid
2756df55934SAndrew Thompson_libusb=	libusb
276a8ec1b48SMaxim Sobolev.endif
277a8ec1b48SMaxim Sobolev
2787be23620SBrooks Davis.if !defined(LIBRARIES_ONLY)
2797c83e443STim Kientzleafterinstall:
2807be23620SBrooks Davis	${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
2817be23620SBrooks Davis.endif
2827c83e443STim Kientzle
28358f0484fSRodney W. Grimes.include <bsd.subdir.mk>
284