bsd.subdir.mk revision 1.32 1 # $NetBSD: bsd.subdir.mk,v 1.32 2000/03/11 14:51:40 aidan Exp $
2 # @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
3
4 .if !target(__initialized__)
5 __initialized__:
6 .if exists(${.CURDIR}/../Makefile.inc)
7 .include "${.CURDIR}/../Makefile.inc"
8 .endif
9 .include <bsd.own.mk>
10 .MAIN: all
11 .endif
12
13 .for dir in ${SUBDIR}
14 .if exists(${dir}.${MACHINE})
15 __REALSUBDIR+=${dir}.${MACHINE}
16 .else
17 __REALSUBDIR+=${dir}
18 .endif
19 .endfor
20
21 .for dir in ${__REALSUBDIR}
22 .for targ in ${TARGETS}
23 .PHONY: ${targ}-${dir}
24 ${targ}-${dir}: .MAKE
25 @case "${dir}" in /*) \
26 echo "${targ} ===> ${dir}"; \
27 cd ${dir}; \
28 ${MAKE} "_THISDIR_=${dir}/" ${targ}; \
29 ;; \
30 *) \
31 echo "${targ} ===> ${_THISDIR_}${dir}"; \
32 cd ${.CURDIR}/${dir}; \
33 ${MAKE} "_THISDIR_=${_THISDIR_}${dir}/" ${targ}; \
34 ;; \
35 esac
36 subdir-${targ}: ${targ}-${dir}
37 ${targ}: subdir-${targ}
38 .endfor
39 .endfor
40
41 # Make sure all of the standard targets are defined, even if they do nothing.
42 ${TARGETS}:
43