1 1.18 mycroft # $NetBSD: bsd.subdir.mk,v 1.18 1997/05/06 23:53:40 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.12 cgd @(_maketarget_="${.TARGET:S/realinstall/install/}"; \ 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.1 cgd .if !target(install) 46 1.1 cgd .if !target(beforeinstall) 47 1.1 cgd beforeinstall: 48 1.1 cgd .endif 49 1.1 cgd .if !target(afterinstall) 50 1.1 cgd afterinstall: 51 1.1 cgd .endif 52 1.13 christos install: ${MANINSTALL} 53 1.13 christos ${MANINSTALL}: afterinstall 54 1.1 cgd afterinstall: realinstall 55 1.5 cgd realinstall: beforeinstall _SUBDIRUSE 56 1.1 cgd .endif 57 1.1 cgd 58 1.6 cgd .if !target(all) 59 1.6 cgd all: _SUBDIRUSE 60 1.6 cgd .endif 61 1.6 cgd 62 1.6 cgd .if !target(clean) 63 1.6 cgd clean: _SUBDIRUSE 64 1.6 cgd .endif 65 1.6 cgd 66 1.6 cgd .if !target(cleandir) 67 1.6 cgd cleandir: _SUBDIRUSE 68 1.11 jtc .endif 69 1.11 jtc 70 1.11 jtc .if !target(includes) 71 1.11 jtc includes: _SUBDIRUSE 72 1.6 cgd .endif 73 1.6 cgd 74 1.6 cgd .if !target(depend) 75 1.6 cgd depend: _SUBDIRUSE 76 1.6 cgd .endif 77 1.6 cgd 78 1.6 cgd .if !target(lint) 79 1.6 cgd lint: _SUBDIRUSE 80 1.6 cgd .endif 81 1.6 cgd 82 1.6 cgd .if !target(obj) 83 1.6 cgd obj: _SUBDIRUSE 84 1.6 cgd .endif 85 1.6 cgd 86 1.6 cgd .if !target(tags) 87 1.6 cgd tags: _SUBDIRUSE 88 1.6 cgd .endif 89 1.8 mycroft 90 1.8 mycroft .include <bsd.own.mk> 91