help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pattern rule dependency question


From: Paul D. Smith
Subject: Re: pattern rule dependency question
Date: Mon, 7 Mar 2005 15:54:20 -0500

%% Der Herr Hofrat <address@hidden> writes:

  dhh> _%: $*

This rule doesn't mean anything.  The automatic variables, like $@, $*,
etc. are not set in prerequisite lists; they are ONLY available inside
command scripts.  So, $* is the global variable "*", which is almost
certainly not set, and this rule basically just says:

    _%:

Which is pretty meaningless.

Second, a pattern rule without a command script does not define
prerequisites as an explicit rule would; instead it deletes the pattern
rule.  Since there is no pattern for _%, this deletes something that
didn't exist and so doesn't do anything.

  dhh> And we then call make as make _video.mss which as I had expected
  dhh> then runs the %.mss rule.

Yes, because _video.mss matches that pattern, but $* here will be
"_video", not "video".

  dhh> but I could not find any note in the info pages stating that
  dhh> automatic variables can't be used in prerequisites

They can't be.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]