1 1.15 christos # $NetBSD: bsd.subdir.mk,v 1.15 1997/04/15 21:32:40 christos 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.15 christos echo "===> $${_nextdir_} [skipped]"; \ 32 1.15 christos fi) 33 1.12 cgd 34 1.12 cgd .for dir in ${SUBDIR} 35 1.12 cgd all-${dir}: __SUBDIRINTERNALUSE 36 1.12 cgd install-${dir}: __SUBDIRINTERNALUSE 37 1.12 cgd realinstall-${dir}: __SUBDIRINTERNALUSE 38 1.12 cgd clean-${dir}: __SUBDIRINTERNALUSE 39 1.12 cgd cleandir-${dir}: __SUBDIRINTERNALUSE 40 1.12 cgd includes-${dir}: __SUBDIRINTERNALUSE 41 1.12 cgd depend-${dir}: __SUBDIRINTERNALUSE 42 1.12 cgd lint-${dir}: __SUBDIRINTERNALUSE 43 1.12 cgd obj-${dir}: __SUBDIRINTERNALUSE 44 1.12 cgd tags-${dir}: __SUBDIRINTERNALUSE 45 1.12 cgd 46 1.12 cgd # Backward-compatibility with the old rules. If this went away, 47 1.12 cgd # 'xlint' could become 'lint', 'xinstall' could become 'install', etc. 48 1.12 cgd ${dir}: all-${dir} 49 1.12 cgd .endfor 50 1.1 cgd 51 1.1 cgd .if !target(install) 52 1.1 cgd .if !target(beforeinstall) 53 1.1 cgd beforeinstall: 54 1.1 cgd .endif 55 1.1 cgd .if !target(afterinstall) 56 1.1 cgd afterinstall: 57 1.1 cgd .endif 58 1.13 christos install: ${MANINSTALL} 59 1.13 christos ${MANINSTALL}: afterinstall 60 1.1 cgd afterinstall: realinstall 61 1.5 cgd realinstall: beforeinstall _SUBDIRUSE 62 1.1 cgd .endif 63 1.1 cgd 64 1.6 cgd .if !target(all) 65 1.6 cgd all: _SUBDIRUSE 66 1.6 cgd .endif 67 1.6 cgd 68 1.6 cgd .if !target(clean) 69 1.6 cgd clean: _SUBDIRUSE 70 1.6 cgd .endif 71 1.6 cgd 72 1.6 cgd .if !target(cleandir) 73 1.6 cgd cleandir: _SUBDIRUSE 74 1.11 jtc .endif 75 1.11 jtc 76 1.11 jtc .if !target(includes) 77 1.11 jtc includes: _SUBDIRUSE 78 1.6 cgd .endif 79 1.6 cgd 80 1.6 cgd .if !target(depend) 81 1.6 cgd depend: _SUBDIRUSE 82 1.6 cgd .endif 83 1.6 cgd 84 1.6 cgd .if !target(lint) 85 1.6 cgd lint: _SUBDIRUSE 86 1.6 cgd .endif 87 1.6 cgd 88 1.6 cgd .if !target(obj) 89 1.6 cgd obj: _SUBDIRUSE 90 1.6 cgd .endif 91 1.6 cgd 92 1.6 cgd .if !target(tags) 93 1.6 cgd tags: _SUBDIRUSE 94 1.6 cgd .endif 95 1.8 mycroft 96 1.8 mycroft .include <bsd.own.mk> 97