1 # $Id: subdir.mk,v 1.14 2012/11/12 04:34:33 sjg Exp $
2 # skip missing directories...
4 # $NetBSD: bsd.subdir.mk,v 1.11 1996/04/04 02:05:06 jtc Exp $
5 # @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
7 .if ${.MAKE.LEVEL} == 0 && ${.MAKE.MODE:Uno:Mmeta*} != ""
8 .include <meta.subdir.mk>
11 .elif !commands(_SUBDIRUSE) && !defined(NO_SUBDIR) && !defined(NOSUBDIR)
12 .if exists(${.CURDIR}/Makefile.inc)
13 .include "Makefile.inc"
20 .ifdef SUBDIR_MUST_EXIST
21 MISSING_DIR=echo "Missing ===> ${.CURDIR}/$${entry}"; exit 1
23 MISSING_DIR=echo "Skipping ===> ${.CURDIR}/$${entry}"; continue
28 @Exists() { test -f $$1; }; \
29 for entry in ${SUBDIR}; do \
31 if Exists ${.CURDIR}/$${entry}.${MACHINE}/[mM]akefile; then \
32 _newdir_="$${entry}.${MACHINE}"; \
33 elif Exists ${.CURDIR}/$${entry}/[mM]akefile; then \
34 _newdir_="$${entry}"; \
38 if test X"${_THISDIR_}" = X""; then \
39 _nextdir_="$${_newdir_}"; \
41 _nextdir_="$${_THISDIR_}/$${_newdir_}"; \
43 ${ECHO_DIR} "===> $${_nextdir_}"; \
44 cd ${.CURDIR}/$${_newdir_}; \
45 ${.MAKE} _THISDIR_="$${_nextdir_}" \
46 ${.TARGET:S/realinstall/install/:S/.depend/depend/}) || exit 1; \
50 @set -e; if test -d ${.CURDIR}/${.TARGET}.${MACHINE}; then \
51 _newdir_=${.TARGET}.${MACHINE}; \
53 _newdir_=${.TARGET}; \
55 ${ECHO_DIR} "===> $${_newdir_}"; \
56 cd ${.CURDIR}/$${_newdir_}; \
57 ${.MAKE} _THISDIR_="$${_newdir_}" all
61 .if !target(beforeinstall)
64 .if !target(afterinstall)
68 maninstall: afterinstall
69 afterinstall: realinstall
70 realinstall: beforeinstall _SUBDIRUSE
75 -cd ${.CURDIR}; etags `echo ${.ALLSRC:N*.h} | sed 's;${.CURDIR}/;;'`
89 .for t in ${SUBDIR_TARGETS:O:u}
98 # make sure this exists