Annotation of src/share/mk/bsd.subdir.mk, Revision 1.35
1.35 ! mycroft 1: # $NetBSD: bsd.subdir.mk,v 1.34 2000/04/16 08:37:27 mrg Exp $
1.14 mikel 2: # @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
1.1 cgd 3:
1.27 mycroft 4: .if !target(__initialized__)
5: __initialized__:
6: .if exists(${.CURDIR}/../Makefile.inc)
7: .include "${.CURDIR}/../Makefile.inc"
8: .endif
1.13 christos 9: .include <bsd.own.mk>
1.27 mycroft 10: .MAIN: all
1.3 mycroft 11: .endif
1.1 cgd 12:
1.25 mycroft 13: .for dir in ${SUBDIR}
14: .if exists(${dir}.${MACHINE})
15: __REALSUBDIR+=${dir}.${MACHINE}
16: .else
17: __REALSUBDIR+=${dir}
18: .endif
19: .endfor
1.1 cgd 20:
1.34 mrg 21: .if defined(DESTDIR) && exists(${DESTDIR}/usr/share/mk/sys.mk)
1.33 mrg 22: _M=-m ${DESTDIR}/usr/share/mk
23: .else
24: _M=
25: .endif
26:
1.35 ! mycroft 27: __recurse: .USE
! 28: @targ=${.TARGET:C/-.*//};dir=${.TARGET:C/.*-//}; \
! 29: case "$$dir" in /*) \
! 30: echo "$$targ ===> $$dir"; \
! 31: cd "$$dir"; \
! 32: ${MAKE} ${_M} "_THISDIR_=$$dir/" $$targ; \
! 33: ;; \
! 34: *) \
! 35: echo "$$targ ===> ${_THISDIR_}$$dir"; \
! 36: cd "${.CURDIR}/$$dir"; \
! 37: ${MAKE} ${_M} "_THISDIR_=${_THISDIR_}$$dir/" $$targ; \
! 38: ;; \
! 39: esac
! 40:
! 41: .for targ in ${TARGETS}
1.25 mycroft 42: .for dir in ${__REALSUBDIR}
1.17 mycroft 43: .PHONY: ${targ}-${dir}
1.35 ! mycroft 44: ${targ}-${dir}: .MAKE __recurse
! 45: ${targ}: ${targ}-${dir}
1.17 mycroft 46: .endfor
1.12 cgd 47: .endfor
1.21 christos 48:
1.26 mycroft 49: # Make sure all of the standard targets are defined, even if they do nothing.
50: ${TARGETS}:
CVSweb <webmaster@jp.NetBSD.org>