help-make
[Top][All Lists]
Advanced

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

Re: let me rephrase that -- question about empty commands


From: Noel Yap
Subject: Re: let me rephrase that -- question about empty commands
Date: Tue, 16 Dec 2003 10:39:20 -0500

Upon re-reading this portion of the paper, I think I may have misunderstood 
exactly what the bug is:

Quick note: why do we have ":" as the command to be run? That's the Bourne 
shell's "do nothing" operator. GNU make is actually smart enough to notice that 
your rule consists of just the "do nothing" operator, and not exec a shell. Why 
don't we just use an
empty command (a semicolon with nothing after it)? We should be able to, but if 
you do then GNU make will print a bunch of warnings about "nothing to do". This 
is actually a bug in GNU make, but this workaround does the job until it's 
fixed. 
 
Anyway, the behaviour I had seen was when I had somithing like the following 
rules:

  .SUFFIXES: _wrap.cc .swg
  $(build.DIR)/common/%_wrap.cc: $(src.DIR)/%.swg
        @$(RmAction)
        $(strip $(SwigAction))

  .SUFFIXES: .pm _wrap.cc
  $(build.DIR)/common/%.pm: $(build.DIR)/common/%_wrap.cc

  .SUFFIXES: .pm
  $(install.DIR)/common/perl/%.pm: $(build.DIR)/common/lib/%.pm
        $(strip $(INSTALL) $(READONLY) $(<) $(@))

  install: $(install.DIR)/common/perl/blah.pm
        # install .pm file

the dependency rule wasn't chained (so that the .pm wouldn't be built at the 
proper time) until I changed the rule to:

  .SUFFIXES: .pm _wrap.cc
  $(build.DIR)/common/%.pm: $(build.DIR)/common/%_wrap.cc
        @:

Is this expected behaviour?

Thanks,
Noel

"Paul D. Smith" wrote:
> 
> %% Noel Yap <address@hidden> writes:
> 
>   ny> Here's what I found in the manual:
> 
>   ny>      We feel that it is cleaner for a rule without commands to always
>   ny>      simply add to the prerequisite list for the target.
> 
>   ny> IIRC, there's a bug in which this doesn't always happen (I think
>   ny> it's mentioned in the multi-architecture paper at
>   ny> paulandlesley.org).  Has a patch been created to fix this bug?
> 
> I'm not aware of any bug like that, nor can I find any reference to a
> bug like that in the doc you refer to...?
> 
> --
> -------------------------------------------------------------------------------
>  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

-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited.




reply via email to

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