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