help-make
[Top][All Lists]
Advanced

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

Re: about :: sign and % sign problems


From: Lin George
Subject: Re: about :: sign and % sign problems
Date: Wed, 26 Apr 2006 06:03:46 -0700 (PDT)

Thanks John!
 
 
> Essentially, :: rules allow the same target to be built in different
> ways by different rules. With : rules there's one rule per target. ::
> are only used in very odd and special cases.
 
What means "the same target to be built in different ways by different rules"? I can not imagine it -- I also can not find samples from GNU make manual of this point. Could you show me an example please?
 
> No, ; doesn't mean do nothing. ; means after this semicolon are
> commands that should be executed for this rule. If there are no
> commands then there are no commands to execute.
 
I think from your above points, it is the same whether or not adding ; -- since whether ; is added or not, the commands after it will be executed (see the below example). Is it useless?
 
example (with ;)
 
Foo:: Goo;
@ls -a
 
example (without ;)
Foo:: Goo
@ls -a
 
 
In above samples, whether or not ; is added, command "ls -a" (without echo) will be executed.
 
 
regards,
George
John Graham-Cumming <address@hidden> wrote:
Lin George wrote:
> What means "::" (I read related parts from GNU make and still confused)?
> What is the difference between "::" and ":"?

I doubt that I can do much better than the explanation in the GNU Make
manual. The reality is that :: rules are very rarely used or needed in
Makefiles, you probably don't need to use anything other than normal :
rules.

Essentially, :: rules allow the same target to be built in different
ways by different rules. With : rules there's one rule per target. ::
are only used in very odd and special cases.

> Another question, ";" means do nothing, why sometimes we still add some
> commands after ;? (I mean, if do nothing, we should not add any commands
> after ";").

No, ; doesn't mean do nothing. ; means after this semicolon are
commands that should be executed for this rule. If there are no
commands then there are no commands to execute.

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/


Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
reply via email to

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