1 1.1.46.1 perseant # $NetBSD: bsd.buildinstall.mk,v 1.1.46.1 2025/08/02 05:55:18 perseant 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.1 joerg SUBDIR_GROUPS= 1 12 1.1 joerg CUR_GROUP:= 1 13 1.1 joerg .for dir in ${SUBDIR} 14 1.1 joerg . if ${dir} == ".WAIT" 15 1.1 joerg CUR_GROUP:= ${CUR_GROUP}1 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.1.46.1 perseant 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