%% Dario Teixeira <[EMAIL PROTECTED]> writes:
dt> Now, the problem happens when I use target-specific variable
dt> values. If I understood the make manual, all prerequisites should
dt> inherit those target-specific variables, but this does not seem to
dt> happen with the implicit rule.
They are inherited; if you printed those values inside the command
script you'd see them.
Check the docs more carefully: target-specific values are ONLY valid
inside command scripts (they have the same lifetime and scoping rules as
automatic variables like $@, etc.)
dt> all: draft
dt> draft: PREFIX=before
dt> draft: SUFFIX=after
dt> draft: prefix_foobar_suffix.out
dt> $(PREFIX)_%_$(SUFFIX).out : $(PREFIX)_%_$(SUFFIX).in
dt> generate $< $@
Here you're trying to use them in a target/prerequisite list: that won't
work.
dt> Also, is there any other way to achieve what I want?
I guess I'm not really sure what you're trying to achieve. Why not just
write:
all: draft
draft: prefix_foobar_suffix.out
%.out : %.in
generate $< $@
??
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make