On Wednesday 17 December 2008, Jason Friedman wrote:
> Hi all,
>
> I have had this make question that has been bugging me for a long time.
>
> I want to fix some eps files using eps2eps. This is the makefile I use:
>
> figure1_fixed.eps: figure1.eps
> [tab] eps2eps $< $@
>
> (replace [tab] with the tab character)
>
> This works fine, but when I have many eps files to convert, I have to
> repeat the command line many times. A similar problem is this one:
>
> figure2.eps: ../../some/other/path/some_long_ugly_filename.eps
>
>
> After lots of googling, I have not been able to find a solution. Is
> there a way to do this in make, if not, can you suggest another tool
> that can do this? I have been running into variants of this problem
> several times.
>

Well, GNU make supports wildcards and expressions and other such features to 
make your makefile more modular. Some other make implementations have similar 
feature, but I have little experience with these make clones.

Here's an example:

{{{{{{{{{{{
EPSES = boule-base.eps graph-3.eps logo.eps

PDFS = $(patsubst %.eps,%.pdf,$(EPSES))

all: to_pdf

to_pdf: $(PDFS)

$(PDFS): %.pdf: %.eps
        epstopdf --outfile=$@ $<
}}}}}}}}}}

If you're looking for an arbitray key->value mapping, you should look at 
http://gmsl.sourceforge.net/ 's associative arrays.

Regards,

        Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
What does "Zionism" mean? - http://xrl.us/bjn8u

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam

=================================================================
To unsubscribe, send mail to linux-il-requ...@cs.huji.ac.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-requ...@cs.huji.ac.il

Reply via email to