Home | History | Annotate | Line # | Download | only in mk
      1  1.3  riastrad #	$NetBSD: bsd.buildinstall.mk,v 1.3 2025/08/25 02:44:31 riastradh Exp $
      2  1.1     joerg 
      3  1.1     joerg #
      4  1.1     joerg # build_install logic for src/Makefile
      5  1.1     joerg # Used by src/lib/Makefile and src/tools/Makefile.
      6  1.1     joerg #
      7  1.1     joerg # Compute a list of subdirectories delimited by .WAIT.
      8  1.1     joerg # Run "make dependall && make install" for all subdirectories in a group
      9  1.1     joerg # concurrently, but wait after each group.
     10  1.1     joerg #
     11  1.3  riastrad SUBDIR_GROUPS=	0
     12  1.3  riastrad CUR_GROUP:=	0
     13  1.1     joerg .for dir in ${SUBDIR}
     14  1.1     joerg .  if ${dir} == ".WAIT"
     15  1.3  riastrad CUR_GROUP:=	${SUBDIR_GROUPS:[#]}
     16  1.1     joerg SUBDIR_GROUPS:=	${SUBDIR_GROUPS} ${CUR_GROUP}
     17  1.1     joerg .  else
     18  1.1     joerg SUBDIR_GROUP.${CUR_GROUP}+=	${dir}
     19  1.1     joerg .endif
     20  1.1     joerg 
     21  1.1     joerg .endfor
     22  1.1     joerg 
     23  1.2    rillig build_install: .MAKE
     24  1.1     joerg .for group in ${SUBDIR_GROUPS}
     25  1.1     joerg .  if !empty(SUBDIR_GROUP.${group})
     26  1.1     joerg 	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/dependall-/}
     27  1.1     joerg 	${MAKEDIRTARGET} . ${SUBDIR_GROUP.${group}:C/^/install-/}
     28  1.1     joerg .  endif
     29  1.1     joerg .endfor
     30