2000-06-06 12:54:06 +04:00
|
|
|
# $NetBSD: bsd.subdir.mk,v 1.38 2000/06/06 08:54:06 mycroft Exp $
|
1997-03-29 11:02:45 +03:00
|
|
|
# @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-10-11 12:16:24 +04:00
|
|
|
.if !target(__initialized__)
|
|
|
|
__initialized__:
|
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
1997-03-25 00:54:12 +03:00
|
|
|
.include <bsd.own.mk>
|
1997-10-11 12:16:24 +04:00
|
|
|
.MAIN: all
|
1993-08-16 00:42:39 +04:00
|
|
|
.endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-03-21 03:53:02 +03:00
|
|
|
.for dir in ${SUBDIR}
|
1997-10-10 13:12:28 +04:00
|
|
|
.if exists(${dir}.${MACHINE})
|
|
|
|
__REALSUBDIR+=${dir}.${MACHINE}
|
|
|
|
.else
|
|
|
|
__REALSUBDIR+=${dir}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2000-04-16 12:37:27 +04:00
|
|
|
.if defined(DESTDIR) && exists(${DESTDIR}/usr/share/mk/sys.mk)
|
2000-04-10 18:47:22 +04:00
|
|
|
_M=-m ${DESTDIR}/usr/share/mk
|
|
|
|
.else
|
|
|
|
_M=
|
|
|
|
.endif
|
|
|
|
|
2000-06-06 09:33:58 +04:00
|
|
|
__recurse: .USE
|
2000-06-06 09:39:26 +04:00
|
|
|
@targ=${.TARGET:C/-.*$//};dir=${.TARGET:C/^[^-]*-//}; \
|
2000-06-06 09:33:58 +04:00
|
|
|
case "$$dir" in /*) \
|
|
|
|
echo "$$targ ===> $$dir"; \
|
|
|
|
cd "$$dir"; \
|
|
|
|
${MAKE} ${_M} "_THISDIR_=$$dir/" $$targ; \
|
|
|
|
;; \
|
|
|
|
*) \
|
|
|
|
echo "$$targ ===> ${_THISDIR_}$$dir"; \
|
|
|
|
cd "${.CURDIR}/$$dir"; \
|
|
|
|
${MAKE} ${_M} "_THISDIR_=${_THISDIR_}$$dir/" $$targ; \
|
|
|
|
;; \
|
|
|
|
esac
|
|
|
|
|
1997-05-07 00:54:31 +04:00
|
|
|
.for targ in ${TARGETS}
|
2000-06-06 09:33:58 +04:00
|
|
|
.for dir in ${__REALSUBDIR}
|
1997-05-07 00:54:31 +04:00
|
|
|
.PHONY: ${targ}-${dir}
|
2000-06-06 09:33:58 +04:00
|
|
|
${targ}-${dir}: .MAKE __recurse
|
2000-06-06 10:49:39 +04:00
|
|
|
subdir-${targ}: ${targ}-${dir}
|
1997-05-07 00:54:31 +04:00
|
|
|
.endfor
|
2000-06-06 12:54:06 +04:00
|
|
|
.if defined(__REALSUBDIR)
|
2000-06-06 10:49:39 +04:00
|
|
|
${targ}: subdir-${targ}
|
2000-06-06 12:54:06 +04:00
|
|
|
.endif
|
1997-03-21 03:53:02 +03:00
|
|
|
.endfor
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-10-11 11:26:53 +04:00
|
|
|
# Make sure all of the standard targets are defined, even if they do nothing.
|
|
|
|
${TARGETS}:
|