[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: |
Paul D. Smith |
Subject: |
Re: let me rephrase that -- question about empty commands |
Date: |
Tue, 16 Dec 2003 10:49:34 -0500 |
%% Noel Yap <address@hidden> writes:
ny> Upon re-reading this portion of the paper, I think I may have
ny> misunderstood exactly what the bug is:
ny> Quick note: why do we have ":" as the command to be run? That's
ny> the Bourne shell's "do nothing" operator. GNU make is actually
ny> smart enough to notice that your rule consists of just the "do
ny> nothing" operator, and not exec a shell. Why don't we just use an
ny> empty command (a semicolon with nothing after it)? We should be
ny> able to, but if you do then GNU make will print a bunch of
ny> warnings about "nothing to do". This is actually a bug in GNU
ny> make, but this workaround does the job until it's fixed.
Right. This has nothing to do with anything: it's to avoid a message
that should not be printed, but there is no change in behavior with or
without it.
ny> Anyway, the behaviour I had seen was when I had somithing like the
ny> following rules:
ny> .SUFFIXES: .pm _wrap.cc
ny> $(build.DIR)/common/%.pm: $(build.DIR)/common/%_wrap.cc
First note that all your uses of .SUFFIXES here are useless: .SUFFIXES
is _ONLY_ used for suffix rules. These are pattern rules, so you don't
need to set .SUFFIXES, and the value of .SUFFIXES isn't used.
ny> .SUFFIXES: .pm _wrap.cc
ny> $(build.DIR)/common/%.pm: $(build.DIR)/common/%_wrap.cc
ny> @:
ny> Is this expected behaviour?
Yes, this is correct behavior. This is a pattern rule, not an explicit
rule like the example in the whitepaper. Pattern rules work
differently.
See the section "Canceling Implicit Rules" in the GNU make manual.
--
-------------------------------------------------------------------------------
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