Makefile revision 1.188
11.188Sjoerg#	$NetBSD: Makefile,v 1.188 2012/08/17 16:22:27 joerg 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.161Srmind.endif
1141.161Srmind
1151.148Smrg.if (${MKCRYPTO} != "no")
1161.158SplunkySUBDIR+=	../crypto/external/bsd/openssl/lib # depends on libcrypt
1171.148Smrg.endif
1181.139Smrg
1191.155SplunkySUBDIR+=	../external/bsd/file/lib	# depends on libz
1201.155Splunky
1211.155Splunky.if (${MKISCSI} != "no")
1221.155SplunkySUBDIR+=	../external/bsd/iscsi/lib	# depends on libpthread
1231.155Splunky.endif
1241.155Splunky
1251.155SplunkySUBDIR+=	../external/bsd/libarchive/lib	# depends on libxz
1261.155Splunky
1271.163Smatt.if (${MKLVM} != "no")
1281.163SmattSUBDIR+=	../external/gpl2/lvm2/lib	# depends on libprop
1291.163Smatt.endif
1301.163Smatt
1311.155Splunky.if (${MKBINUTILS} != "no")
1321.155SplunkySUBDIR+=	../external/gpl3/binutils/lib	# libbfd depends on libz
1331.155Splunky.endif
1341.155Splunky
1351.155Splunky.if (${MKGCC} != "no" && ${MKCXX} != "no")
1361.168Smrg. if ${HAVE_GCC} == 4
1371.155SplunkySUBDIR+=	../gnu/lib/libstdc++-v3_4	# depends on libm
1381.155SplunkySUBDIR+=	../gnu/lib/libsupc++4
1391.170Smrg. else
1401.170SmrgSUBDIR+=	../external/gpl3/gcc/lib/libstdc++-v3
1411.170SmrgSUBDIR+=	../external/gpl3/gcc/lib/libsupc++
1421.168Smrg. endif
1431.155Splunky.endif
1441.155Splunky
1451.97Schristos#==================== 2nd library dependency barrier ====================
1461.97SchristosSUBDIR+=	.WAIT
1471.97Schristos
1481.185Schristos.if (${MKATF} != "no")
1491.186SchristosSUBDIR+=	../external/bsd/atf/lib		# depends on libstdc++
1501.185Schristos.endif
1511.185Schristos
1521.158SplunkySUBDIR+=	libform		# depends on libcurses
1531.175SplunkySUBDIR+=	libmenu		# depends on libcurses
1541.175SplunkySUBDIR+=	libradius	# depends on libcrypto if (${MKCRYPTO} != "no")
1551.187Schristos.if (${MKRUMP} != "no")
1561.175SplunkySUBDIR+=	librump		# depends on librumpuser
1571.187Schristos.endif
1581.158Splunky
1591.100Schristos.if (${MKKERBEROS} != "no")
1601.166SelricSUBDIR+=	../crypto/external/bsd/heimdal/lib	# depends on libcrypto
1611.166Selric							# libedit, libterminfo,
1621.100Schristos.endif
1631.100Schristos
1641.158Splunky.if (${MKCRYPTO} != "no")
1651.158SplunkySUBDIR+=	../crypto/external/bsd/openssh/lib # depends on libcrypto, libz
1661.158SplunkySUBDIR+=	../crypto/external/bsd/netpgp/lib  # depends on libcrypto, ...
1671.158Splunky.endif
1681.158Splunky
1691.158SplunkySUBDIR+=	../external/bsd/bind/lib	# depends on libcrypto
1701.158SplunkySUBDIR+=	../external/bsd/fetch/lib	# depends on libssl
1711.158Splunky
1721.158Splunky.if (${MKLDAP} != "no")
1731.158SplunkySUBDIR+=	../external/bsd/openldap/lib	# depends on libcrypto, ...
1741.158Splunky.endif
1751.158Splunky
1761.124Slukem#==================== 3rd library dependency barrier ====================
1771.124SlukemSUBDIR+=	.WAIT
1781.124Slukem
1791.187Schristos.if (${MKRUMP} != "no")
1801.143SpookaSUBDIR+=	librumpdev	# depends on librump
1811.128SpookaSUBDIR+=	librumpnet	# depends on librump
1821.130SpookaSUBDIR+=	librumpvfs	# depends on librump
1831.187Schristos.endif
1841.126Spooka
1851.175Splunky.if (${MKPAM} != "no")
1861.175SplunkySUBDIR+=	libpam		# depends on heimdal
1871.175Splunky.endif
1881.175Splunky
1891.175Splunky.if (${MKCRYPTO} != "no")
1901.175SplunkySUBDIR+=	../crypto/external/bsd/libsaslc	# depends on heimdal, openssl
1911.175Splunky.endif
1921.175Splunky
1931.181SjoergSUBDIR+=	../external/bsd/mdocml/lib
1941.181Sjoerg
1951.187Schristos.if (${MKRUMP} != "no")
1961.126Spooka#==================== 4th library dependency barrier ====================
1971.126SpookaSUBDIR+=	.WAIT
1981.158Splunky
1991.158SplunkySUBDIR+=	libukfs		# depends on librumpvfs, librump
2001.131Spooka
2011.131Spooka#==================== 5th library dependency barrier ====================
2021.131SpookaSUBDIR+=	.WAIT
2031.158Splunky
2041.158SplunkySUBDIR+=	libp2k		# depends on libukfs, librumpvfs, libpuffs
2051.188Sjoerg
2061.188Sjoerg.if !defined(BSD_MK_COMPAT_FILE)
2071.188SjoergSUBDIR+=	../sys/rump/dev/lib
2081.188SjoergSUBDIR+=	../sys/rump/fs/lib
2091.188SjoergSUBDIR+=	../sys/rump/kern/lib
2101.188SjoergSUBDIR+=	../sys/rump/net/lib
2111.188Sjoerg.endif
2121.187Schristos.endif
2131.158Splunky
2141.178Smbalmer# Lua bindings come last, they might depend on anything
2151.178SmbalmerSUBDIR+=	lua
2161.178Smbalmer
2171.188Sjoerg#
2181.188Sjoerg# build_install logic for src/Makefile.
2191.188Sjoerg# Compute a list of subdirectories delimited by .WAIT.
2201.188Sjoerg# Run "make dependall && make install" for all subdirectories in a group
2211.188Sjoerg# concurrently, but wait after each group.
2221.188Sjoerg#
2231.188SjoergSUBDIR_GROUPS=	1
2241.188SjoergCUR_GROUP:=	1
2251.188Sjoerg.for dir in ${SUBDIR}
2261.188Sjoerg.  if ${dir} == ".WAIT"
2271.188SjoergCUR_GROUP:=	${CUR_GROUP}1
2281.188SjoergSUBDIR_GROUPS:=	${SUBDIR_GROUPS} ${CUR_GROUP}
2291.188Sjoerg.  else
2301.188SjoergSUBDIR_GROUP.${CUR_GROUP}+=	${dir}
2311.188Sjoerg.endif
2321.188Sjoerg
2331.188Sjoerg.endfor
2341.188Sjoerg
2351.188Sjoergbuild_install:
2361.188Sjoerg.for group in ${SUBDIR_GROUPS}
2371.188Sjoerg.  if !empty(SUBDIR_GROUP.${group})
2381.188Sjoerg	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/dependall-/}
2391.188Sjoerg	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/install-/}
2401.188Sjoerg.  endif
2411.188Sjoerg.endfor
2421.188Sjoerg
2431.1Scgd.include <bsd.subdir.mk>
244