Re: [PATCH] Tidy up 'clean' make target



On 03/02/10 01:22, quoth Peter Tyser:
> Previously 'make clean' would not remove the following files: -
> bin/meld.install - meld/paths.py.install
> 
> While we're at it, simplify the removal process by using 'find' instead of
> hardcoding paths.
> 
> Signed-off-by: Peter Tyser <ptyser gmail com> --- GNUmakefile |    4 +++- 1
> files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/GNUmakefile b/GNUmakefile index 90b500b..89a23c1 100644 ---
> a/GNUmakefile +++ b/GNUmakefile @@ -29,7 +29,9 @@ all: $(addsuffix
> .install,$(SPECIALS)) meld.desktop
> 
> .PHONY:clean clean: -	-rm -f meld/*.pyc meld/ui/*.pyc meld/util/*.pyc
> meld/vc/*.pyc *.install data/meld.desktop *.bak data/ui/*.bak +	@find ./
> -type f \( -name '*pyc' -o -name '*install' \ +		-o -name '*.bak' \)
> -print0 | xargs -0 rm -f +	@rm -f data/meld.desktop $(MAKE) -C po clean 
> $(MAKE) -C help clean
> 

I object. The use of globbing is just plain bad form in Makefiles. Given

PYSRCS		:= a b c d e f g
then the right thing to do is to explicitly say

PYS		:= ${PYSRCS:%=%.py}
PYCS		:= ${SRCS:%=%.pyc}

Delete what you own and own what you delete.


-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]