Subject: Re: What am I doing wrong? ("make clean" fails in gnu/usr.bin/grep)
To: Peter Seebach <seebs@plethora.net>
From: Johan Danielsson <joda@pdc.kth.se>
List: current-users
Date: 03/23/2002 21:29:05
seebs@plethora.net (Peter Seebach) writes:

> I re-updated a couple of times, and even nuked these directories and
> tried again.

-P is your friend.

Perhaps grep/Makefile should be taught how to rm -fr grep. It's always
annoying when this happens, especially in the middle of a build.
Somewhat ugly though.

--- Makefile    2001/08/03 14:42:35     1.21
+++ Makefile    2002/03/23 20:27:50
@@ -39,6 +39,15 @@
 LINKS= ${BINDIR}/grep ${BINDIR}/egrep \
        ${BINDIR}/grep ${BINDIR}/fgrep

+clean: remove-bogus-grep-dir
+.PHONY: remove-bogus-grep-dir
+remove-bogus-grep-dir:
+       @if [ -d grep -a "`ls grep | grep -v CVS`" = "" ]; then \
+               echo Removing old CVS directory;\
+               echo rm -fr grep ;\
+               rm -fr grep ;\
+       fi
+
 .include <bsd.info.mk>
 .include <bsd.prog.mk>


/Johan