1 1.19 mycroft # $NetBSD: bsd.subdir.mk,v 1.19 1997/05/07 15:53:35 mycroft Exp $ 2 1.14 mikel # @(#)bsd.subdir.mk 8.1 (Berkeley) 6/8/93 3 1.1 cgd 4 1.13 christos .include <bsd.own.mk> 5 1.13 christos 6 1.3 mycroft .if !target(.MAIN) 7 1.1 cgd .MAIN: all 8 1.3 mycroft .endif 9 1.1 cgd 10 1.12 cgd _SUBDIRUSE: .USE ${SUBDIR:S/^/${.TARGET}-/} 11 1.1 cgd 12 1.12 cgd __SUBDIRINTERNALUSE: .USE 13 1.19 mycroft @(_maketarget_="${.TARGET}"; \ 14 1.12 cgd entry="$${_maketarget_#*-}";\ 15 1.12 cgd target="$${_maketarget_%%-*}";\ 16 1.12 cgd set -e; if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ 17 1.12 cgd _newdir_="$${entry}.${MACHINE}"; \ 18 1.1 cgd else \ 19 1.12 cgd _newdir_="$${entry}"; \ 20 1.1 cgd fi; \ 21 1.12 cgd if test X"${_THISDIR_}" = X""; then \ 22 1.12 cgd _nextdir_="$${_newdir_}"; \ 23 1.12 cgd else \ 24 1.12 cgd _nextdir_="$${_THISDIR_}/$${_newdir_}"; \ 25 1.12 cgd fi; \ 26 1.15 christos if test -d ${.CURDIR}/$${_newdir_}; then \ 27 1.15 christos echo "===> $${_nextdir_}"; \ 28 1.15 christos cd ${.CURDIR}/$${_newdir_}; \ 29 1.15 christos ${MAKE} _THISDIR_="$${_nextdir_}" $${target}; \ 30 1.15 christos else \ 31 1.16 christos echo "===> $${_nextdir_} [skipped: missing]"; \ 32 1.15 christos fi) 33 1.12 cgd 34 1.12 cgd .for dir in ${SUBDIR} 35 1.17 mycroft .for targ in ${TARGETS} 36 1.17 mycroft .PHONY: ${targ}-${dir} 37 1.18 mycroft ${targ}-${dir}: .MAKE __SUBDIRINTERNALUSE 38 1.17 mycroft .endfor 39 1.12 cgd 40 1.12 cgd # Backward-compatibility with the old rules. If this went away, 41 1.12 cgd # 'xlint' could become 'lint', 'xinstall' could become 'install', etc. 42 1.12 cgd ${dir}: all-${dir} 43 1.12 cgd .endfor 44 1.1 cgd 45 1.6 cgd .if !target(all) 46 1.6 cgd all: _SUBDIRUSE 47 1.6 cgd .endif 48 1.6 cgd 49 1.6 cgd .if !target(clean) 50 1.6 cgd clean: _SUBDIRUSE 51 1.6 cgd .endif 52 1.6 cgd 53 1.6 cgd .if !target(cleandir) 54 1.6 cgd cleandir: _SUBDIRUSE 55 1.11 jtc .endif 56 1.11 jtc 57 1.19 mycroft .if !target(depend) 58 1.19 mycroft depend: _SUBDIRUSE 59 1.19 mycroft .endif 60 1.19 mycroft 61 1.11 jtc .if !target(includes) 62 1.11 jtc includes: _SUBDIRUSE 63 1.6 cgd .endif 64 1.6 cgd 65 1.6 cgd .if !target(lint) 66 1.6 cgd lint: _SUBDIRUSE 67 1.6 cgd .endif 68 1.6 cgd 69 1.6 cgd .if !target(obj) 70 1.6 cgd obj: _SUBDIRUSE 71 1.6 cgd .endif 72 1.6 cgd 73 1.6 cgd .if !target(tags) 74 1.6 cgd tags: _SUBDIRUSE 75 1.6 cgd .endif 76 1.8 mycroft 77 1.8 mycroft .include <bsd.own.mk> 78