Makefile revision 1.261
11.261Schristos#	$NetBSD: Makefile,v 1.261 2018/09/08 14:11:41 christos Exp $
21.8Smycroft#	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
31.21Scgd
41.62Sthorpej.include <bsd.own.mk>
51.62Sthorpej
61.188SjoergSUBDIR=		csu .WAIT
71.155Splunky
81.155Splunky.if (${MKGCC} != "no")
91.211SmrgSUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgcc .WAIT
101.155Splunky.endif
111.155Splunky
121.155SplunkySUBDIR+=	libc
131.155SplunkySUBDIR+=	.WAIT
141.155Splunky
151.155Splunky#
161.155Splunky# The SUBDIRs above are included here for completeness but should be built
171.155Splunky# and installed prior to make(dependall) in this file, as libraries listed
181.155Splunky# below will depend on versions from DESTDIR only.
191.155Splunky#
201.155Splunky
211.158SplunkySUBDIR+=	i18n_module
221.158Splunky
231.158SplunkySUBDIR+=	libarch \
241.158Splunky		libbluetooth libbsdmalloc libbz2 \
251.184Smatt		libcompat libcrypt \
261.207Sjoerg		libintl libipsec libkvm libm \
271.259Smaxv		libossaudio libpci libposix libprop libpthread \
281.249Skamil		libpuffs libresolv librmt librpcsvc librt \
291.187Schristos		libtelnet libterminfo \
301.158Splunky		libusbhid libutil libwrap liby libz
311.158Splunky
321.206Smatt.if !defined(BSD_MK_COMPAT_FILE)
331.206SmattSUBDIR+=	libkern
341.206Smatt.endif
351.206Smatt
361.226Smatt.if (${MACHINE_CPU} == "arm" || ${MACHINE_CPU} == "aarch64")
371.201SmattLIBC_MACHINE_ARCH?=${MACHINE_ARCH}
381.228SjoergLIBC_MACHINE_CPU?=${MACHINE_CPU}
391.228Sjoerg.if ${LIBC_MACHINE_CPU} == "arm" && empty(LIBC_MACHINE_ARCH:M*hf*)
401.197SmattSUBDIR+=	libc_vfp
411.197Smatt.endif
421.201Smatt.endif
431.248Smacallan.if ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb"
441.247SmacallanSUBDIR+=	libc_fp
451.247Smacallan.endif
461.187Schristos.if (${MKRUMP} != "no")
471.187SchristosSUBDIR+=	librumpclient
481.187Schristos.endif
491.158Splunky.if (${MKSKEY} != "no")
501.158SplunkySUBDIR+=	libskey
511.158Splunky.endif
521.60Sthorpej
531.155Splunky.if (${MKMDNS} != "no")
541.155SplunkySUBDIR+=	../external/apache2/mDNSResponder/lib
551.155Splunky.endif
561.155Splunky
571.155SplunkySUBDIR+=	../external/bsd/am-utils/lib
581.155Splunky
591.155SplunkySUBDIR+=	../external/bsd/flex/lib
601.180SchristosSUBDIR+=	../external/bsd/tre/lib
611.212SchristosSUBDIR+=	../external/bsd/elftoolchain/lib/libelf
621.163SmattSUBDIR+=	../external/bsd/liblzf/lib
631.158SplunkySUBDIR+=	../external/bsd/libpcap/lib
641.155Splunky
651.214Splunky.if ${MKSLJIT} != "no"
661.214SplunkySUBDIR+=	../external/bsd/sljit/lib
671.214SplunkySUBDIR+=	libbpfjit
681.214Splunky.endif
691.214Splunky
701.261SchristosSUBDIR+=	../external/bsd/libnv/lib
711.261Schristos
721.224Smatt.if (${MKZFS} != "no")
731.224SmattSUBDIR+=        ../external/cddl/osnet/lib/libavl
741.224SmattSUBDIR+=        ../external/cddl/osnet/lib/libnvpair
751.224SmattSUBDIR+=        ../external/cddl/osnet/lib/libumem
761.224SmattSUBDIR+=        ../external/cddl/osnet/lib/libuutil
771.224Smatt.endif
781.224Smatt
791.182StronSUBDIR+=	../external/mit/expat/lib
801.155Splunky
811.179SjoergSUBDIR+=	../external/public-domain/sqlite/lib
821.155Splunky
831.238SchristosSUBDIR+=	../external/gpl2/libmalloc
841.155Splunky
851.155Splunky.if (${MKGCC} != "no")
861.211SmrgSUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libobjc
871.211SmrgSUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libgomp
881.173Smrg# Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
891.173Smrg# specific build area, but we get better parallelism this way.
901.215Smrg# We don't build compat versions of these.
911.252Smrg. if !defined(MLIBDIR) && (${MKGCCCMDS} != "no")
921.172SmattSUBDIR+=	../external/lgpl3/gmp/lib/libgmp
931.174SplunkySUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
941.209SmrgSUBDIR+=	../external/lgpl3/mpc/lib/libmpc
951.174Splunky. endif
961.155Splunky.endif
971.144Schristos
981.89Slukem#
991.89Slukem# Libraries that depend upon any listed previously
1001.93Slukem# (and those that depend upon these [and ...])
1011.89Slukem#
1021.97Schristos#==================== 1st library dependency barrier ====================
1031.97SchristosSUBDIR+=	.WAIT
1041.97Schristos
1051.235Schristos.if ${MKDTRACE} != "no"
1061.229SchristosSUBDIR+=	../external/bsd/librtld_db/lib		# depends on libutil
1071.234Schristos.endif
1081.229Schristos
1091.240Sriastrad.if ${MKCTF} != "no"
1101.227SchristosSUBDIR+=        ../external/cddl/osnet/lib/libctf
1111.227Schristos.endif
1121.227Schristos
1131.221SmrgSUBDIR+=	../external/public-domain/xz/lib	# depends on libpthread
1141.208SmrgSUBDIR+=	../crypto/external/bsd/netpgp/libmj
1151.208SmrgSUBDIR+=	../crypto/external/bsd/netpgp/lib/verify # depends on libz
1161.237SchristosSUBDIR+=	../external/bsd/blacklist/lib		# depends on libpthread
1171.212SchristosSUBDIR+=	../external/bsd/elftoolchain/lib/libdwarf # depends on libelf
1181.208SmrgSUBDIR+=	../external/mit/lua/lib # depends on libm
1191.158SplunkySUBDIR+=	libcurses	# depends on libterminfo
1201.162ShaadSUBDIR+=	libdm		# depends on libprop
1211.158SplunkySUBDIR+=	libedit		# depends on libterminfo
1221.184SmattSUBDIR+=	libexecinfo 	# depends on libelf
1231.176SdyoungSUBDIR+=	libppath	# depends on libprop
1241.175SplunkySUBDIR+=	libperfuse	# depends on libpuffs
1251.165SbouyerSUBDIR+=	libquota	# depends on libprop and librpcsvc
1261.113SpookaSUBDIR+=	librefuse	# depends on libpuffs
1271.207SjoergSUBDIR+=	libisns 	# depends on libpthread
1281.187Schristos.if (${MKRUMP} != "no")
1291.253SchristosSUBDIR+=	librumphijack	# depends on librumpclient and libpthread
1301.253SchristosSUBDIR+=	librumpres	# depends on librumpclient
1311.126SpookaSUBDIR+=	librumpuser	# depends on libpthread
1321.187Schristos.endif
1331.126Spooka
1341.161Srmind.if (${MKNPF} != "no")
1351.261SchristosSUBDIR+=	libnpf		# depends on libnv
1361.161Srmind.endif
1371.161Srmind
1381.254SchristosSUBDIR+=	../crypto/external/bsd/${EXTERNAL_OPENSSL_SUBDIR}/lib # depends on libcrypt
1391.155SplunkySUBDIR+=	../external/bsd/file/lib	# depends on libz
1401.155Splunky
1411.155Splunky.if (${MKISCSI} != "no")
1421.155SplunkySUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
1431.155Splunky.endif
1441.155Splunky
1451.224Smatt.if (${MKZFS} != "no")
1461.257SchsSUBDIR+=        ../external/cddl/osnet/lib/libzfs_core
1471.224SmattSUBDIR+=        ../external/cddl/osnet/lib/libzpool
1481.224Smatt.endif
1491.224Smatt
1501.163Smatt.if (${MKLVM} != "no")
1511.163SmattSUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
1521.163Smatt.endif
1531.163Smatt
1541.155Splunky.if (${MKBINUTILS} != "no")
1551.239SchristosSUBDIR+=	../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/lib	# libbfd depends on libz
1561.155Splunky.endif
1571.155Splunky
1581.202Sjoerg.if (${MKLIBCXX} != "no")
1591.202SjoergSUBDIR+=	../external/bsd/libc++
1601.202Sjoerg.endif
1611.202Sjoerg
1621.203Sjoerg.if (${MKGCC} != "no" && ${MKCXX} != "no" && ${MKLIBSTDCXX} != "no")
1631.211SmrgSUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libstdc++-v3
1641.211SmrgSUBDIR+=	../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/libsupc++
1651.155Splunky.endif
1661.222Schristos
1671.222Schristos#==================== 2nd library dependency barrier ====================
1681.222SchristosSUBDIR+=	.WAIT
1691.222Schristos
1701.258Schristos.for sanitizer in asan lsan ubsan
1711.245Schristos.if exists(../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer})
1721.245SchristosSUBDIR+= ../external/gpl3/${EXTERNAL_GCC_SUBDIR}/lib/lib${sanitizer}
1731.245Schristos.endif
1741.245Schristos.endfor
1751.155Splunky
1761.221SmrgSUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz
1771.221Smrg
1781.208Smrg.if (${MKNPF} != "no")
1791.208SmrgSUBDIR+=	npf		# depends on libnpf
1801.208Smrg.endif
1811.208Smrg
1821.185Schristos.if (${MKATF} != "no")
1831.186SchristosSUBDIR+=	../external/bsd/atf/lib		# depends on libstdc++
1841.185Schristos.endif
1851.185Schristos
1861.198Sjmmv.if (${MKKYUA} != "no")
1871.198SjmmvSUBDIR+=	../external/bsd/lutok/lib	# depends on lua and libstdc++
1881.198Sjmmv.endif
1891.198Sjmmv
1901.158SplunkySUBDIR+=	libform		# depends on libcurses
1911.175SplunkySUBDIR+=	libmenu		# depends on libcurses
1921.236SkamilSUBDIR+=	libpanel	# depends on libcurses
1931.251SriastradSUBDIR+=	libradius	# depends on libcrypto
1941.187Schristos.if (${MKRUMP} != "no")
1951.175SplunkySUBDIR+=	librump		# depends on librumpuser
1961.187Schristos.endif
1971.158Splunky
1981.100Schristos.if (${MKKERBEROS} != "no")
1991.166SelricSUBDIR+=	../crypto/external/bsd/heimdal/lib	# depends on libcrypto
2001.166Selric							# libedit, libterminfo,
2011.100Schristos.endif
2021.100Schristos
2031.158SplunkySUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
2041.158SplunkySUBDIR+=	../crypto/external/bsd/netpgp/lib  # depends on libcrypto, ...
2051.199SchristosSUBDIR+=	../external/bsd/libevent/lib	# depends on libcrypto
2061.235Schristos.if ${MKDTRACE} != "no"
2071.234SchristosSUBDIR+=	../external/bsd/libproc/lib	# depends on libstdc++, libctf
2081.234Schristos.endif
2091.158SplunkySUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
2101.158Splunky
2111.158Splunky.if (${MKLDAP} != "no")
2121.158SplunkySUBDIR+=	../external/bsd/openldap/lib	# depends on libcrypto, ...
2131.158Splunky.endif
2141.158Splunky
2151.257Schs.if (${MKZFS} != "no")
2161.257SchsSUBDIR+=        ../external/cddl/osnet/lib/libzfs
2171.257Schs.endif
2181.257Schs
2191.256SsevanSUBDIR+= 	../libexec/httpd/libbozohttpd 	# depends on libssl & libcrypto
2201.256Ssevan
2211.124Slukem#==================== 3rd library dependency barrier ====================
2221.124SlukemSUBDIR+=	.WAIT
2231.124Slukem
2241.255SchristosSUBDIR+=	../crypto/external/bsd/netpgp/bindings/lua  # depends on netpgp/lib
2251.260SchristosSUBDIR+=	../external/mpl/bind/lib	# depends on heimdal, libcrypto
2261.251Sriastrad.if ${MKUNBOUND} != "no"
2271.246SchristosSUBDIR+=	../external/bsd/unbound/lib	# depends on libcrypto
2281.246Schristos.endif
2291.204Sjoerg
2301.230Schristos.if ${MKDTRACE} != "no"
2311.230SchristosSUBDIR+=        ../external/cddl/osnet/lib/libdtrace	# depends on libproc
2321.230Schristos.endif
2331.230Schristos
2341.187Schristos.if (${MKRUMP} != "no")
2351.143SpookaSUBDIR+=	librumpdev	# depends on librump
2361.128SpookaSUBDIR+=	librumpnet	# depends on librump
2371.130SpookaSUBDIR+=	librumpvfs	# depends on librump
2381.187Schristos.endif
2391.126Spooka
2401.175Splunky.if (${MKPAM} != "no")
2411.175SplunkySUBDIR+=	libpam		# depends on heimdal
2421.175Splunky.endif
2431.175Splunky
2441.175SplunkySUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
2451.181SjoergSUBDIR+=	../external/bsd/mdocml/lib
2461.181Sjoerg
2471.187Schristos.if (${MKRUMP} != "no")
2481.126Spooka#==================== 4th library dependency barrier ====================
2491.126SpookaSUBDIR+=	.WAIT
2501.158Splunky
2511.158SplunkySUBDIR+=	libukfs		# depends on librumpvfs, librump
2521.131Spooka
2531.190Schristos.if (${MKTPM} != "no")
2541.190SchristosSUBDIR+=	../crypto/external/cpl/trousers/lib
2551.190Schristos.endif
2561.190Schristos
2571.131Spooka#==================== 5th library dependency barrier ====================
2581.131SpookaSUBDIR+=	.WAIT
2591.158Splunky
2601.158SplunkySUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
2611.188Sjoerg
2621.192Schristos.if (${MKTPM} != "no")
2631.192SchristosSUBDIR+=	../crypto/external/cpl/tpm-tools/lib	# depends on trousers
2641.192Schristos.endif
2651.192Schristos
2661.188Sjoerg.if !defined(BSD_MK_COMPAT_FILE)
2671.188SjoergSUBDIR+=	../sys/rump/dev/lib
2681.188SjoergSUBDIR+=	../sys/rump/fs/lib
2691.188SjoergSUBDIR+=	../sys/rump/kern/lib
2701.188SjoergSUBDIR+=	../sys/rump/net/lib
2711.188Sjoerg.endif
2721.187Schristos.endif
2731.158Splunky
2741.178Smbalmer# Lua bindings come last, they might depend on anything
2751.178SmbalmerSUBDIR+=	lua
2761.178Smbalmer
2771.210Schristos# Needed by rump and rescue which are outside the smbfs tree
2781.210SchristosSUBDIR+=	../external/bsd/smbfs/lib
2791.210Schristos
2801.251Sriastrad.for S in ${SUBDIR}
2811.251Sriastrad.if ${S} != ".WAIT"
2821.251SriastradSUBLIB_${S}!=	cd ${S} && ${MAKE} -V LIB
2831.251SriastradSUBDEP_${S}!=	cd ${S} && ${MAKE} -V LIBDPLIBS
2841.251Sriastrad.endif
2851.251Sriastrad.endfor
2861.251Sriastrad
2871.251Sriastradshowdeps:
2881.251Sriastrad.for S in ${SUBDIR}
2891.251Sriastrad.if ${S} != ".WAIT"
2901.251Sriastrad.for DL DD in ${SUBDEP_${S}}
2911.251Sriastrad	@echo ${S} ${SUBLIB_${S}} ${DL} ${DD:C,^${.CURDIR}/,,}
2921.251Sriastrad.endfor
2931.251Sriastrad.endif
2941.251Sriastrad.endfor
2951.251Sriastrad
2961.195Sjoerg.include <bsd.buildinstall.mk>
2971.1Scgd.include <bsd.subdir.mk>
298