diff --git a/share/mk/bsd.README b/share/mk/bsd.README index a64229aed262..cd8722d7b57e 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -167,7 +167,9 @@ BINOWN Binary owner. BINMODE Binary mode. -CLEANFILES Additional files to remove for the clean and cleandir targets. +CLEANFILES Additional files to remove and +CLEANDIRS additional directories to remove during clean and cleandir + targets. "rm -f" and "rm -rf" used respectively. COPTS Additional flags to the compiler when creating C objects. diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 95bc690ef70b..7fd8d070faf5 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.lib.mk 5.26 (Berkeley) 5/2/91 -# $Id: bsd.lib.mk,v 1.33 1996/05/28 16:20:11 phk Exp $ +# $Id: bsd.lib.mk,v 1.34 1996/06/03 13:23:31 jfieber Exp $ # .if exists(${.CURDIR}/../Makefile.inc) @@ -190,6 +190,9 @@ clean: _LIBSUBDIR rm -f ${POBJS} profiled/*.o lib${LIB}_p.a rm -f ${SOBJS} shared/*.o rm -f lib${LIB}.so.*.* lib${LIB}_pic.a +.if defined(CLEANDIRS) + rm -rf ${CLEANDIRS} +.endif .endif .if !target(cleandir) @@ -200,6 +203,9 @@ cleandir: _LIBSUBDIR rm -f ${POBJS} profiled/*.o lib${LIB}_p.a rm -f ${SOBJS} shared/*.o rm -f lib${LIB}.so.*.* lib${LIB}_pic.a +.if defined(CLEANDIRS) + rm -rf ${CLEANDIRS} +.endif cd ${.CURDIR}; rm -rf obj; .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index de0b438a7ea0..2a171ed6c405 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,5 +1,5 @@ # from: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $Id: bsd.prog.mk,v 1.30 1996/03/24 00:41:11 wosch Exp $ +# $Id: bsd.prog.mk,v 1.31 1996/06/17 12:31:02 jkh Exp $ .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" @@ -152,12 +152,18 @@ all: ${PROG} all-man _PROGSUBDIR .if !target(clean) clean: _PROGSUBDIR rm -f a.out Errs errs mklog ${PROG} ${OBJS} ${CLEANFILES} +.if defined(CLEANDIRS) + rm -rf ${CLEANDIRS} +.endif .endif .if !target(cleandir) cleandir: _PROGSUBDIR rm -f a.out Errs errs mklog ${PROG} ${OBJS} ${CLEANFILES} rm -f ${.CURDIR}/tags .depend +.if defined(CLEANDIRS) + rm -rf ${CLEANDIRS} +.endif cd ${.CURDIR}; rm -rf obj; .endif