On Mon, Mar 14, 2011 at 5:30 AM,  <jida...@jidanni.org> wrote:
> (info "(make) Automatic Variables") says
> `$*'
>     The stem with which an implicit rule matches
>
> OK, that is the stem. Now mention what can we use to get the other half.
> OK, the answer apparently is here. Please mention it.
> %.xcf %.jpeg:%.pdf; gs -sDEVICE=$(subst .,,$(suffix $@)) -sOutputFile=$@ 
> -dNOPAUSE -dBATCH $?
>                                ^^^^^^^^^^^^^^^^^^^^^^^^

That rule is not correct: it *claims* to generate both whatever.xcf
_and_ whatever.jpeg when its commands are run, but it does not do so.
The result is that if you ask make to build both files, it will only
generate one of them.  You need separate pattern rules to get what you
want.

I would probably just write it like this:

run_gs = gs -sDEVICE=$1 -sOutputFile=$@ -dNOPAUSE -dBATCH $<
%.xcf: %.pdf; $(call run_gs,xcf)
%.jpeg: %.pdf: $(call run_gs,jpeg)

(Yes, you could use $(foreach) and $(eval) to iterate across the types
and define rules for each...and it'll take you longer to write and GNU
make longer to process.)


Philip Guenther

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to