1997-06-01 01:21:13 +04:00
|
|
|
# $NetBSD: bsd.subdir.mk,v 1.24 1997/05/31 21:22:00 cjs 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-03-25 00:54:12 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
.if !target(.MAIN)
|
1993-03-21 12:45:37 +03: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
|
|
|
_SUBDIRUSE: .USE ${SUBDIR:S/^/${.TARGET}-/}
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-03-21 03:53:02 +03:00
|
|
|
__SUBDIRINTERNALUSE: .USE
|
1997-05-07 19:53:28 +04:00
|
|
|
@(_maketarget_="${.TARGET}"; \
|
1997-03-21 03:53:02 +03:00
|
|
|
entry="$${_maketarget_#*-}";\
|
|
|
|
target="$${_maketarget_%%-*}";\
|
|
|
|
set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \
|
|
|
|
_newdir_="$${entry}.${MACHINE}"; \
|
1993-03-21 12:45:37 +03:00
|
|
|
else \
|
1997-03-21 03:53:02 +03:00
|
|
|
_newdir_="$${entry}"; \
|
1993-03-21 12:45:37 +03:00
|
|
|
fi; \
|
1997-03-21 03:53:02 +03:00
|
|
|
if test X"${_THISDIR_}" = X""; then \
|
|
|
|
_nextdir_="$${_newdir_}"; \
|
|
|
|
else \
|
|
|
|
_nextdir_="$${_THISDIR_}/$${_newdir_}"; \
|
|
|
|
fi; \
|
1997-04-16 01:32:40 +04:00
|
|
|
if test -d ${.CURDIR}/$${_newdir_}; then \
|
|
|
|
echo "===> $${_nextdir_}"; \
|
|
|
|
cd ${.CURDIR}/$${_newdir_}; \
|
|
|
|
${MAKE} _THISDIR_="$${_nextdir_}" $${target}; \
|
|
|
|
else \
|
1997-04-16 18:09:16 +04:00
|
|
|
echo "===> $${_nextdir_} [skipped: missing]"; \
|
1997-04-16 01:32:40 +04:00
|
|
|
fi)
|
1997-03-21 03:53:02 +03:00
|
|
|
|
|
|
|
.for dir in ${SUBDIR}
|
1997-05-07 00:54:31 +04:00
|
|
|
.for targ in ${TARGETS}
|
|
|
|
.PHONY: ${targ}-${dir}
|
1997-05-07 03:53:40 +04:00
|
|
|
${targ}-${dir}: .MAKE __SUBDIRINTERNALUSE
|
1997-05-07 00:54:31 +04:00
|
|
|
.endfor
|
1997-03-21 03:53:02 +03:00
|
|
|
|
|
|
|
# Backward-compatibility with the old rules. If this went away,
|
|
|
|
# 'xlint' could become 'lint', 'xinstall' could become 'install', etc.
|
|
|
|
${dir}: all-${dir}
|
|
|
|
.endfor
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-05-07 21:06:16 +04:00
|
|
|
.for targ in ${TARGETS}
|
|
|
|
${targ}: _SUBDIRUSE
|
|
|
|
.endfor
|
1994-07-26 23:42:37 +04:00
|
|
|
|
1997-05-27 21:45:57 +04:00
|
|
|
.if defined(SUBDIR) && !empty(SUBDIR)
|
|
|
|
realinstall: ${SUBDIR:S/^/install-/g}
|
|
|
|
.endif
|
|
|
|
|
1994-07-26 23:42:37 +04:00
|
|
|
.include <bsd.own.mk>
|