[Techtalk] Re: Loop/wildcard-like syntax for GNU make?

Michelle Konzack linux4michelle at freenet.de
Thu Apr 19 16:43:17 UTC 2007


Am 2007-04-18 09:28:51, schrieb Conor Daly:
> This works for a straight cp and should work with convert also:
> 
> all:
> 	for FILE in *.png; do \
> 		cp -f $$FILE $$(basename "$$FILE" png)jpg; \
> 	done;

Please read the manual to gnu make why you should avoid shell loops.

Why not:
-----------------------------------------------
GIFS := $(wildcard *.gif)

all: $(GIFS)

$(GIFS):
	convert $@ $(patsubst %.gif,%,$@).jpg

.PHONY: all $(GIFS)
-----------------------------------------------

Greetings
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


More information about the Techtalk mailing list