help-make
[Top][All Lists]
Advanced

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

Re: confused about double-colon "terminal" rules


From: John Graham-Cumming
Subject: Re: confused about double-colon "terminal" rules
Date: Fri, 03 Mar 2006 19:54:05 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

Robert P. J. Day wrote:
"One choice is to mark the match-anything rule as terminal by defining
it with a double colon. When a rule is terminal, it does not apply
unless its prerequisites actually exist. Prerequisites that could be
made with other implicit rules are not good enough. In other words, no
further chaining is allowed beyond a terminal rule."

  so i have this trivial makefile:

t1::    hi
        @echo hi there

and in that directory, i have the source file "hi.c".  now, the
prerequisite of "hi" could clearly be built using the implicit pattern
rule for compiling C files but, according to the above manual excerpt,
a terminal rule should *absolutely* not consider other implicit rules.

so ...

$ make t1
cc      hi.c    -o hi
hi
$

  huh?  why was an implicit rule used to build that dependency?  how
am i misreading this?

Firstly the section you are quoting refers to "match-anything rules". Those are rules whose LHS is '%:' or '%::".

Secondly the example you give is not for a pattern rule at all, but for a standard non-pattern rule. All you've done is define a double colon rule.

The concept of a terminal rule is specifically related to pattern matching rules to prevent enormous searches.

John.
--
John Graham-Cumming
address@hidden

Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/

POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/




reply via email to

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