[Top][All Lists]

[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 
Anyway, the behaviour I had seen was when I had somithing like the following 

  .SUFFIXES: .swg
  $(build.DIR)/common/ $(src.DIR)/%.swg
        $(strip $(SwigAction))

  .SUFFIXES: .pm
  $(build.DIR)/common/ $(build.DIR)/common/

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

  install: $(install.DIR)/common/perl/
        # 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
  $(build.DIR)/common/ $(build.DIR)/common/

Is this expected behaviour?


"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>  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:
>  "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]