FIND_FILES =$(filter $(1)-%,$(FIG_FILE_NAMES:=.eps))
$(FILE_NAMES:=.dvi): %.dvi :%.tex $(call FIND_FILES,%)
where
FILE_NAMES = cap1 cap2 cap3
FIG_FILE_NAMES = cap1-1 cap2-1 cap2-2 cap3-1 cap3-2
My aim is to make a set of rules like these
cap1.dvi: cap1.tex cap1-1.eps
cap2.dvi: cap2.tex cap2-1.eps cap2-2.eps
cap3.dvi: cap3.tex cap3-1.eps cap3-2.eps
I don't understand why my static rule doesn't work, the problem could
be the double use of % as 'stem' for rule and 'wildcard' for filter,
but I'm not sure.
Thanks
Riccardo de Maria
rdm> I've problems using filter function to find prerequisites.
rdm> My static rule is:
rdm> FIND_FILES =$(filter $(1)-%,$(FIG_FILE_NAMES:=.eps))
rdm> $(FILE_NAMES:=.dvi): %.dvi :%.tex $(call FIND_FILES,%)
You cannot call functions, etc. on the patterns, nor can you use auto
variables such as $@, etc. in prerequisite lines.
Functions and variables in target and prerequisites are evaluated when
the makefile is read in, before patterns or auto variables are
instantiated.
--
-------------------------------------------------------------------------------
Paul D. Smith <psm...@gnu.org> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
> Functions and variables in target and prerequisites are evaluated when
> the makefile is read in, before patterns or auto variables are
> instantiated.
What a pity! Do you know a way for doing what I want?
I have a large number of cap*-*.fig files and cap*.tex files thus
making dependances tree by hand is very tedious.
Riccardo de Maria
> Find some GNU make tips at:
http://www.paulandlesley.org/gmake/
BTW, Paul, your site explaining how to properly use VPATH and how to set
up multi-architecture builds is (pretending that I'm younger and hipper
than I realy am) "AWESOME" and it has truly changed my life as a hacker.
Kudos.
Soren Andersen
--
# Advanced (or lunatic, depending on your POV) examples of Gmake use:
# || MakefileWorkshop: ||
# http://home.att.net/~perlspinr/makefiles/makefileworkshop.html
#########################################################