Mailing List Archive

[PATCH] Making make clean really work
I discovered that make clean didn't /really/ work due to someone having
a mental picture of find's operation that differed slightly from the one
find itself had ;)

patch: Rules-make-clean-target.patch
description: Make make clean really clean up
--- cvs/netfilter/userspace/Rules.make Sun Jan 14 13:35:28 2001
+++ netfilter/userspace/Rules.make Tue Jul 24 23:44:30 2001
@@ -5,10 +5,12 @@
experimental: $(EXTRAS_EXP)

# Have to handle extensions which no longer exist.
+.PHONY: clean
clean: $(EXTRA_CLEANS)
rm -f $(SHARED_LIBS) $(EXTRAS) $(EXTRAS_EXP)
$(SHARED_LIBS:%.so=%_sh.o)
- @find . -name '*.[ao]' -name '*.so' | xargs rm -f
+ @find . -name '*.[ao]' -o -name '*.so' | xargs rm -f

+.PHONY: install
install: all $(EXTRA_INSTALLS)
@if [ -f /usr/local/bin/iptables -a "$(BINDIR)" =
"/usr/local/sbin" ];\
then echo 'Erasing iptables from old location (now
/usr/local/sbin).';\


-Peter

See also http://oss.one2one-networks.com/
Re: [PATCH] Making make clean really work [ In reply to ]
On Wed, Jul 25, 2001 at 12:13:55AM +0200, Peter Firefly Lund wrote:
> I discovered that make clean didn't /really/ work due to someone having
> a mental picture of find's operation that differed slightly from the one
> find itself had ;)

hm.

a) the PHONY patches are ok.

b) the find syntax is correct, AFAICT. I think it should either be like
it currently is, or " -name '*.[ao]' -o '*.so' (which has the same
meaning as what we currently have

> -Peter
> See also http://oss.one2one-networks.com/

--
Live long and prosper
- Harald Welte / laforge@gnumonks.org http://www.gnumonks.org
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M-
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)
Re: [PATCH] Making make clean really work [ In reply to ]
On Tue, Jul 31, 2001 at 08:35:55AM +0200, Peter Firefly Lund wrote:
> Harald Welte wrote:
>
> > On Wed, Jul 25, 2001 at 12:13:55AM +0200, Peter Firefly Lund wrote:
> > > I discovered that make clean didn't /really/ work due to someone having
> > > a mental picture of find's operation that differed slightly from the one
> > > find itself had ;)
> >
> > hm.
> >
> > a) the PHONY patches are ok.
> >
> > b) the find syntax is correct, AFAICT. I think it should either be like
> > it currently is, or " -name '*.[ao]' -o '*.so' (which has the same
> > meaning as what we currently have
>
> No. As it stands now the -name operations ("filters") are connected by an
> implicit and. That needs to be an or instead. Take a look at the Linux
> makefiles, they use -o, too.

ok, convinced. Changed now

Thanks again.

> -Peter

--
Live long and prosper
- Harald Welte / laforge@gnumonks.org http://www.gnumonks.org
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M-
V-- PS+ PE-- Y+ PGP++ t++ 5-- !X !R tv-- b+++ DI? !D G+ e* h+ r% y+(*)
Re: [PATCH] Making make clean really work [ In reply to ]
Harald Welte wrote:

> On Wed, Jul 25, 2001 at 12:13:55AM +0200, Peter Firefly Lund wrote:
> > I discovered that make clean didn't /really/ work due to someone having
> > a mental picture of find's operation that differed slightly from the one
> > find itself had ;)
>
> hm.
>
> a) the PHONY patches are ok.
>
> b) the find syntax is correct, AFAICT. I think it should either be like
> it currently is, or " -name '*.[ao]' -o '*.so' (which has the same
> meaning as what we currently have

No. As it stands now the -name operations ("filters") are connected by an
implicit and. That needs to be an or instead. Take a look at the Linux
makefiles, they use -o, too.

From the man page:

OPERATORS
Listed in order of decreasing precedence:

( expr )
Force precedence.

! expr True if expr is false.

-not expr
Same as ! expr.

expr1 expr2
And (implied); expr2 is not evaluated if expr1 is
false.

expr1 -a expr2
Same as expr1 expr2.

expr1 -and expr2
Same as expr1 expr2.

expr1 -o expr2
Or; expr2 is not evaluated if expr1 is true.

expr1 -or expr2
Same as expr1 -o expr2.


Besides, like I sincerely hope I've written a couple of places, it didn't clean
up properly before and it does now. (I was trying to add some fprintf(stderr,
....) to libiptc.c and accidentally left a libiptc4.o file lying around which
make clean /didn't/ clean up).

That misunderstand wasted almost all of one of my Fridays. Or was it Mondays?
So place accept the patch... ;)

-Peter
Re: [PATCH] Making make clean really work [ In reply to ]
[about find syntax /and/ semantics]

>That misunderstand wasted almost all of one of my Fridays. Or was it Mondays?
>So place accept the patch... ;)

s/place/please/

-Peter