diff options
author | sjg <sjg@FreeBSD.org> | 2014-05-05 18:17:26 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-05-05 18:17:26 +0000 |
commit | d2002298873d23fcdface936c7bf2f0796eb762f (patch) | |
tree | 54f3b0c9446d2b90b5549f3f62ff85111aa2d9a3 | |
parent | 99f653488ffd98ebb2540c647b3cb3218b2c623a (diff) | |
download | FreeBSD-src-d2002298873d23fcdface936c7bf2f0796eb762f.zip FreeBSD-src-d2002298873d23fcdface936c7bf2f0796eb762f.tar.gz |
If doing destroy-all and at top-level whack stage tree too.
-rw-r--r-- | share/mk/bsd.obj.mk | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index d2a6bd7..27a60ae 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -153,21 +153,42 @@ cleandir: cleanobj _OBJDIR?= ${.OBJDIR} _CURDIR?= ${.CURDIR} +# destroy almost everything +destroy: destroy-all +destroy-all: + +# just remove our objdir destroy-arch: .NOMETA .if ${_OBJDIR} != ${_CURDIR} cd ${_CURDIR} && rm -rf ${_OBJDIR} .endif -destroy: destroy-all -destroy-all: +.if defined(HOST_OBJTOP) +destroy-host: destroy.host +destroy.host: .NOMETA + cd ${_CURDIR} && rm -rf ${HOST_OBJTOP}/${RELDIR:N.} +.endif -.if ${_OBJDIR} != ${_CURDIR} +.if make(destroy-all) && ${RELDIR} == "." +destroy-all: destroy-stage +.endif + +# remove the stage tree +destroy-stage: .NOMETA +.if defined(STAGE_ROOT) + cd ${_CURDIR} && rm -rf ${STAGE_ROOT} +.endif + +# allow parallel destruction .for m in ${ALL_MACHINE_LIST} destroy-all: destroy.$m +.if !target(destroy.$m) destroy.$m: .NOMETA +.if ${_OBJDIR} != ${_CURDIR} cd ${_CURDIR} && rm -rf ${OBJROOT}$m*/${RELDIR:N.} -.endfor .endif +.endif +.endfor .endif |