[Techtalk] Re: Loop/wildcard-like syntax for GNU make?
Wim De Smet
kromagg at gmail.com
Thu Apr 19 22:58:31 UTC 2007
On 4/20/07, Conor Daly <conor.daly-linuxchix at cod.homelinux.org> wrote:
> On Thu, Apr 19, 2007 at 06:43:17PM +0200 or so it is rumoured hereabouts,
> Michelle Konzack thought:
> > 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.
> I read the manual far enough to figure out _how_ to do shell loops. Now I
> have to go and read why not?!!! Arrgh!!
Heh, I think the point is that if you use a loop to do this, make has
no idea whether any of the files need updating, so every time you do
this all the files will be updated, and not just the ones that need
There, saved you 10 minutes at least. :-)
More information about the Techtalk