xref: /freebsd/lib/Makefile (revision 71b5e1bb760490507b35a17f4824f2d05a4d8852)
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 \
359b3e440bSWarner Losh	libbsm \
369b3e440bSWarner Losh	libauditd \
3739cd938cSEd Schouten	libcompiler_rt \
389b3e440bSWarner Losh	libcrypt \
399b3e440bSWarner Losh	libelf \
40ad30f8e7SGabor Kovesdan	${_libiconv_modules} \
419b3e440bSWarner Losh	libkvm \
42*71b5e1bbSDag-Erling Smørgrav	${_libldns} \
439b3e440bSWarner Losh	msun \
449b3e440bSWarner Losh	libmd \
459b3e440bSWarner Losh	ncurses \
469b3e440bSWarner Losh	${_libnetgraph} \
479b3e440bSWarner Losh	libradius \
489b3e440bSWarner Losh	librpcsvc \
499b3e440bSWarner Losh	libsbuf \
509b3e440bSWarner Losh	libtacplus \
519b3e440bSWarner Losh	libutil \
5249c8e5e7SDimitry Andric	${_libypclnt} \
5349c8e5e7SDimitry Andric	${_libcxxrt} \
5449c8e5e7SDimitry Andric	${_libcplusplus}
559b3e440bSWarner Losh
560e46933cSStanislav Sedov.if ${MK_KERBEROS_SUPPORT} != "no"
570e46933cSStanislav SedovSUBDIR_ORDERED+=	libcom_err
580e46933cSStanislav Sedov.endif
590e46933cSStanislav Sedov
609b3e440bSWarner LoshSUBDIR=	${SUBDIR_ORDERED} \
619b3e440bSWarner Losh	libalias \
629b3e440bSWarner Losh	libarchive \
639b3e440bSWarner Losh	${_libatm} \
649b3e440bSWarner Losh	libbegemot \
6539cd938cSEd Schouten	libblocksruntime \
669b3e440bSWarner Losh	${_libbluetooth} \
679b3e440bSWarner Losh	${_libbsnmp} \
689b3e440bSWarner Losh	libbz2 \
699b3e440bSWarner Losh	libcalendar \
709b3e440bSWarner Losh	libcam \
719b3e440bSWarner Losh	libcompat \
729b3e440bSWarner Losh	libdevinfo \
739b3e440bSWarner Losh	libdevstat \
749b3e440bSWarner Losh	libdwarf \
759b3e440bSWarner Losh	libedit \
769b3e440bSWarner Losh	${_libefi} \
774b1fb8ffSEd Maste	libexecinfo \
789b3e440bSWarner Losh	libexpat \
799b3e440bSWarner Losh	libfetch \
809b3e440bSWarner Losh	libgeom \
819b3e440bSWarner Losh	${_libgpib} \
829b3e440bSWarner Losh	${_libgssapi} \
839b3e440bSWarner Losh	${_librpcsec_gss} \
840ff204bbSPeter Wemm	${_libiconv_compat} \
859b3e440bSWarner Losh	libipsec \
869b3e440bSWarner Losh	${_libipx} \
879b3e440bSWarner Losh	libjail \
889b3e440bSWarner Losh	libkiconv \
8981ad8388SMartin Matuska	liblzma \
909b3e440bSWarner Losh	libmagic \
91cc4842a1SUlrich Spörlein	libmandoc \
929b3e440bSWarner Losh	libmemstat \
939b3e440bSWarner Losh	${_libmilter} \
949b3e440bSWarner Losh	${_libmp} \
957f725bcdSGrzegorz Bernacki	${_libnandfs} \
966bea8766SBrooks Davis	libnetbsd \
979b3e440bSWarner Losh	${_libngatm} \
989b3e440bSWarner Losh	libopie \
999b3e440bSWarner Losh	libpam \
1009b3e440bSWarner Losh	libpcap \
1019b3e440bSWarner Losh	${_libpmc} \
10254bb94d7SRui Paulo	${_libproc} \
1030daf62d9SStanislav Sedov	libprocstat \
1049b3e440bSWarner Losh	librt \
105fb05b666SRui Paulo	${_librtld_db} \
1069b3e440bSWarner Losh	${_libsdp} \
1079b3e440bSWarner Losh	${_libsm} \
108237abf0cSDavide Italiano	${_libsmb} \
1099b3e440bSWarner Losh	${_libsmdb} \
1109b3e440bSWarner Losh	${_libsmutil} \
1119b3e440bSWarner Losh	libstand \
1126486b015SJeremie Le Hen	libstdbuf \
113fc6f0665SEd Schouten	libstdthreads \
1149b3e440bSWarner Losh	${_libtelnet} \
1159b3e440bSWarner Losh	${_libthr} \
1169b3e440bSWarner Losh	libthread_db \
1179b3e440bSWarner Losh	libufs \
1189b3e440bSWarner Losh	libugidfw \
1199b3e440bSWarner Losh	libulog \
1208f8790cdSDag-Erling Smørgrav	${_libunbound} \
1219b3e440bSWarner Losh	${_libusbhid} \
1229b3e440bSWarner Losh	${_libusb} \
1239b3e440bSWarner Losh	${_libvgl} \
124366f6083SPeter Grehan	${_libvmmapi} \
1259b3e440bSWarner Losh	libwrap \
1269b3e440bSWarner Losh	liby \
127e51c53f3SBaptiste Daroussin	libyaml \
1289b3e440bSWarner Losh	libz \
129c175365cSMarcel Moolenaar	${_atf} \
1306513cfc8SRoman Divacky	${_bind} \
1316513cfc8SRoman Divacky	${_clang}
13258f0484fSRodney W. Grimes
1332bef81cfSWarner Losh.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
1342bef81cfSWarner Losh_csu=csu/${MACHINE_ARCH}-elf
135b12277d1SNathan Whitehorn.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
136b12277d1SNathan Whitehorn_csu=csu/${MACHINE_ARCH}
13725faff34SWarner Losh.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
13825faff34SWarner Losh_csu=csu/${MACHINE_CPUARCH}
13956a91a6fSDavid E. O'Brien.else
14056a91a6fSDavid E. O'Brien_csu=csu
141b09f41a4SJohn Birrell.endif
142b09f41a4SJohn Birrell
143690f477dSSam Leffler# NB: keep these sorted by MK_* knobs
144690f477dSSam Leffler
145c175365cSMarcel Moolenaar.if ${MK_ATF} != "no"
146c175365cSMarcel Moolenaar_atf=		atf
147c175365cSMarcel Moolenaar.endif
148c175365cSMarcel Moolenaar
149e1fe3dbaSRuslan Ermilov.if ${MK_ATM} != "no"
1509e9dbe04SHartmut Brandt_libngatm=	libngatm
1515e1847b4SPoul-Henning Kamp.endif
1525e1847b4SPoul-Henning Kamp
153e1fe3dbaSRuslan Ermilov.if ${MK_BIND} != "no"
154cd3ee173SDag-Erling Smørgrav_bind=		bind
155072355e0SPeter Wemm.endif
156072355e0SPeter Wemm
157e1fe3dbaSRuslan Ermilov.if ${MK_BLUETOOTH} != "no"
1580986ab12SMaksim Yevmenkin_libbluetooth=	libbluetooth
1590986ab12SMaksim Yevmenkin_libsdp=	libsdp
16018d948adSMaksim Yevmenkin.endif
16123d1e148SMaksim Yevmenkin
162690f477dSSam Leffler.if ${MK_BSNMP} != "no"
163690f477dSSam Leffler_libbsnmp=	libbsnmp
164690f477dSSam Leffler.endif
165690f477dSSam Leffler
166bfc72ed5SEd Schouten.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT)
1676513cfc8SRoman Divacky_clang=		clang
1686513cfc8SRoman Divacky.endif
1696513cfc8SRoman Divacky
170690f477dSSam Leffler.if ${MK_GPIB} != "no"
171690f477dSSam Leffler_libgpib=	libgpib
172690f477dSSam Leffler.endif
173690f477dSSam Leffler
1746dc51ecaSRuslan Ermilov.if ${MK_GSSAPI} != "no"
1753fe21f77SDoug Barton_libgssapi=	libgssapi
1768f55a568SDoug Rabson_librpcsec_gss=	librpcsec_gss
1773fe21f77SDoug Barton.endif
1783fe21f77SDoug Barton
179ad30f8e7SGabor Kovesdan.if ${MK_ICONV} != "no"
180ad30f8e7SGabor Kovesdan_libiconv_modules=	libiconv_modules
181ad30f8e7SGabor Kovesdan.endif
182ad30f8e7SGabor Kovesdan
183cea557adSRuslan Ermilov.if ${MK_IPX} != "no"
184cea557adSRuslan Ermilov_libipx=	libipx
185cea557adSRuslan Ermilov.endif
186cea557adSRuslan Ermilov
1877b5038d7SDag-Erling Smørgrav.if ${MK_LDNS} != "no"
1887b5038d7SDag-Erling Smørgrav_libldns=	libldns
1897b5038d7SDag-Erling Smørgrav.endif
1907b5038d7SDag-Erling Smørgrav
19135e370a2SDag-Erling Smørgrav.if ${MK_LIBCPLUSPLUS} != "no"
19235e370a2SDag-Erling Smørgrav_libcxxrt=	libcxxrt
19335e370a2SDag-Erling Smørgrav_libcplusplus=	libc++
19435e370a2SDag-Erling Smørgrav.endif
19535e370a2SDag-Erling Smørgrav
1960ff204bbSPeter Wemm.if ${MK_LIBICONV_COMPAT} != "no"
1970ff204bbSPeter Wemm_libiconv_compat=	libiconv_compat
1980ff204bbSPeter Wemm.endif
1990ff204bbSPeter Wemm
200690f477dSSam Leffler.if ${MK_LIBTHR} != "no"
201690f477dSSam Leffler_libthr=	libthr
202690f477dSSam Leffler.endif
203690f477dSSam Leffler
2047f725bcdSGrzegorz Bernacki.if ${MK_NAND} != "no"
2057f725bcdSGrzegorz Bernacki_libnandfs=	libnandfs
2067f725bcdSGrzegorz Bernacki.endif
2077f725bcdSGrzegorz Bernacki
208690f477dSSam Leffler.if ${MK_NETGRAPH} != "no"
209690f477dSSam Leffler_libnetgraph=	libnetgraph
210690f477dSSam Leffler.endif
211690f477dSSam Leffler
212690f477dSSam Leffler.if ${MK_NIS} != "no"
213690f477dSSam Leffler_libypclnt=	libypclnt
214690f477dSSam Leffler.endif
215690f477dSSam Leffler
21625faff34SWarner Losh.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
217237abf0cSDavide Italiano_libsmb=	libsmb
218c9811e98SBruce Evans_libvgl=	libvgl
21954bb94d7SRui Paulo_libproc=	libproc
220fb05b666SRui Paulo_librtld_db=	librtld_db
221abbb0b30SMarcel Moolenaar.endif
222abbb0b30SMarcel Moolenaar
22370d8f36aSPeter Grehan.if ${MACHINE_CPUARCH} == "amd64"
22470d8f36aSPeter Grehan_libvmmapi=	libvmmapi
22570d8f36aSPeter Grehan.endif
22670d8f36aSPeter Grehan
22725faff34SWarner Losh.if ${MACHINE_CPUARCH} == "ia64"
228eb0a7e41SMarcel Moolenaar_libefi=	libefi
229237abf0cSDavide Italiano_libsmb=	libsmb
230e108ac65SMarcel Moolenaar.endif
231e108ac65SMarcel Moolenaar
23207d39325SOleksandr Tymoshenko.if ${MACHINE_CPUARCH} == "mips"
23307d39325SOleksandr Tymoshenko_libproc=	libproc
23407d39325SOleksandr Tymoshenko_librtld_db=	librtld_db
23507d39325SOleksandr Tymoshenko.endif
23607d39325SOleksandr Tymoshenko
237c7570492SJustin Hibbits.if ${MACHINE_CPUARCH} == "powerpc"
238c7570492SJustin Hibbits_libproc=	libproc
239c7570492SJustin Hibbits_librtld_db=	librtld_db
240237abf0cSDavide Italiano_libsmb=	libsmb
241237abf0cSDavide Italiano.endif
242237abf0cSDavide Italiano
243237abf0cSDavide Italiano.if ${MACHINE_CPUARCH} == "sparc64"
244237abf0cSDavide Italiano_libsmb=	libsmb
245c7570492SJustin Hibbits.endif
246c7570492SJustin Hibbits
247690f477dSSam Leffler.if ${MK_OPENSSL} != "no"
248690f477dSSam Leffler_libmp=		libmp
249690f477dSSam Leffler.endif
250690f477dSSam Leffler
251690f477dSSam Leffler.if ${MK_PMC} != "no"
252690f477dSSam Leffler_libpmc=	libpmc
253690f477dSSam Leffler.endif
254690f477dSSam Leffler
255690f477dSSam Leffler.if ${MK_SENDMAIL} != "no"
256690f477dSSam Leffler_libmilter=	libmilter
257690f477dSSam Leffler_libsm=		libsm
258690f477dSSam Leffler_libsmdb=	libsmdb
259690f477dSSam Leffler_libsmutil=	libsmutil
260690f477dSSam Leffler.endif
261690f477dSSam Leffler
262690f477dSSam Leffler.if ${MK_TELNET} != "no"
263690f477dSSam Leffler_libtelnet=	libtelnet
264e9043a12SMike Makonnen.endif
265e9043a12SMike Makonnen
2668f8790cdSDag-Erling Smørgrav.if ${MK_UNBOUND} != "no"
2678f8790cdSDag-Erling Smørgrav_libunbound=	libunbound
2688f8790cdSDag-Erling Smørgrav.endif
2698f8790cdSDag-Erling Smørgrav
270e1fe3dbaSRuslan Ermilov.if ${MK_USB} != "no"
271f3e5ff40SBruce Evans_libusbhid=	libusbhid
2726df55934SAndrew Thompson_libusb=	libusb
273a8ec1b48SMaxim Sobolev.endif
274a8ec1b48SMaxim Sobolev
2757be23620SBrooks Davis.if !defined(LIBRARIES_ONLY)
2767c83e443STim Kientzleafterinstall:
2777be23620SBrooks Davis	${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include
2787be23620SBrooks Davis.endif
2797c83e443STim Kientzle
28058f0484fSRodney W. Grimes.include <bsd.subdir.mk>
281