xref: /netbsd-src/share/mk/bsd.buildinstall.mk (revision 54f191bfce6a040732e8047153e2b5c35278f965)
1#	$NetBSD: bsd.buildinstall.mk,v 1.1 2012/11/15 23:51:53 joerg Exp $
2
3#
4# build_install logic for src/Makefile
5# Used by src/lib/Makefile and src/tools/Makefile.
6#
7# Compute a list of subdirectories delimited by .WAIT.
8# Run "make dependall && make install" for all subdirectories in a group
9# concurrently, but wait after each group.
10#
11SUBDIR_GROUPS=	1
12CUR_GROUP:=	1
13.for dir in ${SUBDIR}
14.  if ${dir} == ".WAIT"
15CUR_GROUP:=	${CUR_GROUP}1
16SUBDIR_GROUPS:=	${SUBDIR_GROUPS} ${CUR_GROUP}
17.  else
18SUBDIR_GROUP.${CUR_GROUP}+=	${dir}
19.endif
20
21.endfor
22
23build_install:
24.for group in ${SUBDIR_GROUPS}
25.  if !empty(SUBDIR_GROUP.${group})
26	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/dependall-/}
27	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/install-/}
28.  endif
29.endfor
30