1 # $NetBSD: bsd.subdir.mk,v 1.50 2009/11/29 16:00:00 uebayasi Exp $
2 # @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
6 .if
!defined
(NOSUBDIR
) # {
9 .if
"${dir}" == ".WAIT"
10 # Don't play with .WAI
14 # It is a relative path; make it absolute so exists can't search the path.
15 .if exists
(${.CURDIR
}/${dir}.
${MACHINE})
16 __REALSUBDIR
+=${dir}.
${MACHINE}
21 # It is an absolute path; leave it alone
22 .if exists
(${dir}.
${MACHINE})
23 __REALSUBDIR
+=${dir}.
${MACHINE}
32 @
${MAKEDIRTARGET} ${.TARGET
:C
/^
[^
-]*-//} ${.TARGET
:C
/-.
*$//}
35 __RECURSETARG
= ${TARGETS
:Nclean
}
38 __RECURSETARG
= ${TARGETS}
41 # for obscure reasons, we can't do a simple .if ${dir} == ".WAIT"
42 # but have to assign to __TARGDIR first.
43 .for targ in
${__RECURSETARG}
44 .for
dir in
${__REALSUBDIR}
46 .if
${__TARGDIR} == ".WAIT"
47 SUBDIR_
${targ} += .WAIT
48 .elif
!commands
(${targ}-${dir})
49 ${targ}-${dir}: .PHONY .MAKE __recurse
50 SUBDIR_
${targ} += ${targ}-${dir}
53 subdir-
${targ}: .PHONY
${SUBDIR_
${targ}}
54 ${targ}: subdir-
${targ}
57 .
endif # ! NOSUBDIR # }
59 ${TARGETS}: # ensure existence