Makefile revision 1.190
11.190Schristos#	$NetBSD: Makefile,v 1.190 2012/11/04 16:28:11 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.169Smrg. if ${HAVE_GCC} == 4
101.169Smrg.  if (${USE_COMPILERCRTSTUFF} == "yes")
111.188SjoergSUBDIR+=	../gnu/lib/crtstuff4 .WAIT
121.169Smrg.  endif
131.188SjoergSUBDIR+=	../gnu/lib/libgcc4 .WAIT
141.169Smrg. else
151.169Smrg.  if (${USE_COMPILERCRTSTUFF} == "yes")
161.188SjoergSUBDIR+=	../external/gpl3/gcc/lib/crtstuff .WAIT
171.169Smrg.  endif
181.188SjoergSUBDIR+=	../external/gpl3/gcc/lib/libgcc .WAIT
191.169Smrg. endif
201.155Splunky.endif
211.155Splunky
221.155SplunkySUBDIR+=	libc
231.155SplunkySUBDIR+=	.WAIT
241.155Splunky
251.155Splunky#
261.155Splunky# The SUBDIRs above are included here for completeness but should be built
271.155Splunky# and installed prior to make(dependall) in this file, as libraries listed
281.155Splunky# below will depend on versions from DESTDIR only.
291.155Splunky#
301.155Splunky
311.158SplunkySUBDIR+=	i18n_module
321.158Splunky
331.158SplunkySUBDIR+=	libarch \
341.158Splunky		libbluetooth libbsdmalloc libbz2 \
351.184Smatt		libcompat libcrypt \
361.159Sagc		libintl libipsec libisns libkvm libm \
371.158Splunky		libossaudio libpci libpmc libposix libprop libpthread \
381.158Splunky		libpthread_dbg libpuffs libresolv librmt librpcsvc librt \
391.187Schristos		libtelnet libterminfo \
401.158Splunky		libusbhid libutil libwrap liby libz
411.158Splunky
421.187Schristos.if (${MKRUMP} != "no")
431.187SchristosSUBDIR+=	librumpclient
441.187Schristos.endif
451.158Splunky.if (${MKSKEY} != "no")
461.158SplunkySUBDIR+=	libskey
471.158Splunky.endif
481.60Sthorpej
491.158Splunky.if (${MKCRYPTO} != "no")
501.158SplunkySUBDIR+=	../crypto/external/bsd/netpgp/libmj
511.158Splunky.endif
521.156Schristos
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.155SplunkySUBDIR+=	../external/bsd/libdwarf/lib
621.155SplunkySUBDIR+=	../external/bsd/libelf/lib
631.155SplunkySUBDIR+=	../external/bsd/libevent/lib
641.163SmattSUBDIR+=	../external/bsd/liblzf/lib
651.158SplunkySUBDIR+=	../external/bsd/libpcap/lib
661.155Splunky
671.155SplunkySUBDIR+=	../external/mit/lua/lib
681.182StronSUBDIR+=	../external/mit/expat/lib
691.155Splunky
701.179SjoergSUBDIR+=	../external/public-domain/sqlite/lib
711.155SplunkySUBDIR+=	../external/public-domain/xz/lib
721.155Splunky
731.155SplunkySUBDIR+=	../gnu/lib/libmalloc
741.155Splunky
751.155Splunky.if (${MKGCC} != "no")
761.168Smrg. if ${HAVE_GCC} == 4
771.155SplunkySUBDIR+=	../gnu/lib/libobjc4
781.170Smrg. else
791.170SmrgSUBDIR+=	../external/gpl3/gcc/lib/libobjc
801.177SmrgSUBDIR+=	../external/gpl3/gcc/lib/libgomp
811.168Smrg. endif
821.174Splunky. if ${HAVE_GCC} >= 45 && !defined(MLIBDIR)
831.173Smrg# Should probably move GMP, MPFR and MPC builds into the GCC >= 4.5
841.173Smrg# specific build area, but we get better parallelism this way.
851.172SmattSUBDIR+=	../external/lgpl3/gmp/lib/libgmp
861.174SplunkySUBDIR+=	../external/lgpl3/mpfr/lib/libmpfr
871.174SplunkySUBDIR+=	../external/lgpl2/mpc/lib/libmpc
881.174Splunky. endif
891.155Splunky.endif
901.144Schristos
911.89Slukem#
921.89Slukem# Libraries that depend upon any listed previously
931.93Slukem# (and those that depend upon these [and ...])
941.89Slukem#
951.97Schristos#==================== 1st library dependency barrier ====================
961.97SchristosSUBDIR+=	.WAIT
971.97Schristos
981.158SplunkySUBDIR+=	libcurses	# depends on libterminfo
991.162ShaadSUBDIR+=	libdm		# depends on libprop
1001.158SplunkySUBDIR+=	libedit		# depends on libterminfo
1011.184SmattSUBDIR+=	libexecinfo 	# depends on libelf
1021.176SdyoungSUBDIR+=	libppath	# depends on libprop
1031.175SplunkySUBDIR+=	libperfuse	# depends on libpuffs
1041.165SbouyerSUBDIR+=	libquota	# depends on libprop and librpcsvc
1051.113SpookaSUBDIR+=	librefuse	# depends on libpuffs
1061.187Schristos.if (${MKRUMP} != "no")
1071.126SpookaSUBDIR+=	librumpuser	# depends on libpthread
1081.175SplunkySUBDIR+=	librumphijack	# depends on librumpclient and libpthread
1091.187Schristos.endif
1101.126Spooka
1111.161Srmind.if (${MKNPF} != "no")
1121.161SrmindSUBDIR+=	libnpf		# depends on libprop
1131.189SrmindSUBDIR+=	npf
1141.161Srmind.endif
1151.161Srmind
1161.148Smrg.if (${MKCRYPTO} != "no")
1171.158SplunkySUBDIR+=	../crypto/external/bsd/openssl/lib # depends on libcrypt
1181.148Smrg.endif
1191.139Smrg
1201.155SplunkySUBDIR+=	../external/bsd/file/lib	# depends on libz
1211.155Splunky
1221.155Splunky.if (${MKISCSI} != "no")
1231.155SplunkySUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
1241.155Splunky.endif
1251.155Splunky
1261.155SplunkySUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz
1271.155Splunky
1281.163Smatt.if (${MKLVM} != "no")
1291.163SmattSUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
1301.163Smatt.endif
1311.163Smatt
1321.155Splunky.if (${MKBINUTILS} != "no")
1331.155SplunkySUBDIR+=	../external/gpl3/binutils/lib	# libbfd depends on libz
1341.155Splunky.endif
1351.155Splunky
1361.155Splunky.if (${MKGCC} != "no" && ${MKCXX} != "no")
1371.168Smrg. if ${HAVE_GCC} == 4
1381.155SplunkySUBDIR+=	../gnu/lib/libstdc++-v3_4	# depends on libm
1391.155SplunkySUBDIR+=	../gnu/lib/libsupc++4
1401.170Smrg. else
1411.170SmrgSUBDIR+=	../external/gpl3/gcc/lib/libstdc++-v3
1421.170SmrgSUBDIR+=	../external/gpl3/gcc/lib/libsupc++
1431.168Smrg. endif
1441.155Splunky.endif
1451.155Splunky
1461.97Schristos#==================== 2nd library dependency barrier ====================
1471.97SchristosSUBDIR+=	.WAIT
1481.97Schristos
1491.185Schristos.if (${MKATF} != "no")
1501.186SchristosSUBDIR+=	../external/bsd/atf/lib		# depends on libstdc++
1511.185Schristos.endif
1521.185Schristos
1531.158SplunkySUBDIR+=	libform		# depends on libcurses
1541.175SplunkySUBDIR+=	libmenu		# depends on libcurses
1551.175SplunkySUBDIR+=	libradius	# depends on libcrypto if (${MKCRYPTO} != "no")
1561.187Schristos.if (${MKRUMP} != "no")
1571.175SplunkySUBDIR+=	librump		# depends on librumpuser
1581.187Schristos.endif
1591.158Splunky
1601.100Schristos.if (${MKKERBEROS} != "no")
1611.166SelricSUBDIR+=	../crypto/external/bsd/heimdal/lib	# depends on libcrypto
1621.166Selric							# libedit, libterminfo,
1631.100Schristos.endif
1641.100Schristos
1651.158Splunky.if (${MKCRYPTO} != "no")
1661.158SplunkySUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
1671.158SplunkySUBDIR+=	../crypto/external/bsd/netpgp/lib  # depends on libcrypto, ...
1681.158Splunky.endif
1691.158Splunky
1701.158SplunkySUBDIR+=	../external/bsd/bind/lib	# depends on libcrypto
1711.158SplunkySUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
1721.158Splunky
1731.158Splunky.if (${MKLDAP} != "no")
1741.158SplunkySUBDIR+=	../external/bsd/openldap/lib	# depends on libcrypto, ...
1751.158Splunky.endif
1761.158Splunky
1771.124Slukem#==================== 3rd library dependency barrier ====================
1781.124SlukemSUBDIR+=	.WAIT
1791.124Slukem
1801.187Schristos.if (${MKRUMP} != "no")
1811.143SpookaSUBDIR+=	librumpdev	# depends on librump
1821.128SpookaSUBDIR+=	librumpnet	# depends on librump
1831.130SpookaSUBDIR+=	librumpvfs	# depends on librump
1841.187Schristos.endif
1851.126Spooka
1861.175Splunky.if (${MKPAM} != "no")
1871.175SplunkySUBDIR+=	libpam		# depends on heimdal
1881.175Splunky.endif
1891.175Splunky
1901.175Splunky.if (${MKCRYPTO} != "no")
1911.175SplunkySUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
1921.175Splunky.endif
1931.175Splunky
1941.181SjoergSUBDIR+=	../external/bsd/mdocml/lib
1951.181Sjoerg
1961.187Schristos.if (${MKRUMP} != "no")
1971.126Spooka#==================== 4th library dependency barrier ====================
1981.126SpookaSUBDIR+=	.WAIT
1991.158Splunky
2001.158SplunkySUBDIR+=	libukfs		# depends on librumpvfs, librump
2011.131Spooka
2021.190Schristos.if (${MKTPM} != "no")
2031.190SchristosSUBDIR+=	../crypto/external/cpl/trousers/lib
2041.190SchristosSUBDIR+=	../crypto/external/cpl/tpm_tools/lib
2051.190Schristos.endif
2061.190Schristos
2071.131Spooka#==================== 5th library dependency barrier ====================
2081.131SpookaSUBDIR+=	.WAIT
2091.158Splunky
2101.158SplunkySUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
2111.188Sjoerg
2121.188Sjoerg.if !defined(BSD_MK_COMPAT_FILE)
2131.188SjoergSUBDIR+=	../sys/rump/dev/lib
2141.188SjoergSUBDIR+=	../sys/rump/fs/lib
2151.188SjoergSUBDIR+=	../sys/rump/kern/lib
2161.188SjoergSUBDIR+=	../sys/rump/net/lib
2171.188Sjoerg.endif
2181.187Schristos.endif
2191.158Splunky
2201.178Smbalmer# Lua bindings come last, they might depend on anything
2211.178SmbalmerSUBDIR+=	lua
2221.178Smbalmer
2231.188Sjoerg#
2241.188Sjoerg# build_install logic for src/Makefile.
2251.188Sjoerg# Compute a list of subdirectories delimited by .WAIT.
2261.188Sjoerg# Run "make dependall && make install" for all subdirectories in a group
2271.188Sjoerg# concurrently, but wait after each group.
2281.188Sjoerg#
2291.188SjoergSUBDIR_GROUPS=	1
2301.188SjoergCUR_GROUP:=	1
2311.188Sjoerg.for dir in ${SUBDIR}
2321.188Sjoerg.  if ${dir} == ".WAIT"
2331.188SjoergCUR_GROUP:=	${CUR_GROUP}1
2341.188SjoergSUBDIR_GROUPS:=	${SUBDIR_GROUPS} ${CUR_GROUP}
2351.188Sjoerg.  else
2361.188SjoergSUBDIR_GROUP.${CUR_GROUP}+=	${dir}
2371.188Sjoerg.endif
2381.188Sjoerg
2391.188Sjoerg.endfor
2401.188Sjoerg
2411.188Sjoergbuild_install:
2421.188Sjoerg.for group in ${SUBDIR_GROUPS}
2431.188Sjoerg.  if !empty(SUBDIR_GROUP.${group})
2441.188Sjoerg	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/dependall-/}
2451.188Sjoerg	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/install-/}
2461.188Sjoerg.  endif
2471.188Sjoerg.endfor
2481.188Sjoerg
2491.1Scgd.include <bsd.subdir.mk>
250