home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] Loop/wildcard-like syntax for GNU make?



This one anchors the the gif so gif isn't replaced inside the filename (just
the extension).  Guess could also add a . on there so it only matches things
that end in .gif instead of anything that ends in gif.

all:
        for i in *.[Gg][Ii][Ff]; do make `echo $${i} | sed
s/"[gG][iI][fF]$$"/jpg/g`; done

%.jpg: %.[gG][iI][fF]
        convert $*.[gG][iI][fF] $*.jpg


On 4/17/07, Matthew Bowie <niosop at gmail.com> wrote:
>
> Here's something that's probably more what you were looking for.
>
> all:
>         for i in *.[Gg][Ii][Ff]; do make `echo $${i} | sed
> s/"[gG][iI][fF]"/jpg/g`; done
>
> %.jpg: %.[gG][iI][fF]
>         convert $*.[gG][iI][fF] $*.jpg
>
> Seems to work for me, but might depend on your shell, etc.  Might want to
> set the SHELL variable to be sure it works.
>
> Matt
>
>
> --
> Matthew Bowie
> Programmer/IT Consultant
> niosop at gmail.com
>



-- 
Matthew Bowie
Programmer/IT Consultant
niosop at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.b9.com/pipermail/nmlug/attachments/20070417/100ab282/attachment.htm 




Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache