[Top][All Lists]
[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.
- Re: about :: sign and % sign problems, (continued)
- Re: about :: sign and % sign problems, Lin George, 2006/04/26
- Re: about :: sign and % sign problems, John Graham-Cumming, 2006/04/26
- Re: about :: sign and % sign problems, Paul D. Smith, 2006/04/26
- Re: about :: sign and % sign problems, Lin George, 2006/04/26
- Re: about :: sign and % sign problems, Paul D. Smith, 2006/04/26
- Re: about :: sign and % sign problems, Lin George, 2006/04/26
- Re: about :: sign and % sign problems, Paul D. Smith, 2006/04/26
- Re: about :: sign and % sign problems, Lin George, 2006/04/26
- Re: about :: sign and % sign problems, Paul D. Smith, 2006/04/27
- Re: about :: sign and % sign problems, Lin George, 2006/04/28
- Re: about :: sign and % sign problems,
Lin George <=