A common pattern in my makefiles is to use a pattern rule to handle most
cases, while overriding it for particular targets. In the following
example, it was due to a bug in lua(la)tex that required using pdflatex
with a few of the input files:
blah.pdf: blah.asy
asy -tex pdflatex $<
%.pdf: %.asy
asy -tex lualatex $<
(Asy is the asymptote figure-drawing program.)
A direct translation into tup
: blah.asy |> asy -tex pdflatex -f pdf %f |> blah.pdf
: foreach *.asy |> asy -tex lualatex -f pdf %f |> %B.pdf
fails because blah.pdf is claimed by two rules.
What is the idiom for this pattern? The following notation modification
might be useful:
: foreach *.asy except blah.asy |> asy -tex lualatex -f pdf %f |> %B.pdf
Even easier: A target is rebuilt using the first rule that grabs it, as
with make (maybe with a warning about multiple rules?). But there could
well be problems with that approach that I don't see right away.
--
-Sanjoy
<http://savelongwharfpark.org/>
Save Long Wharf Park in Boston Harbor!
<http://streetfightingmath.com/>
Six reasoning tools to make hard problems easy.
--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.