help-make
[Top][All Lists]
Advanced

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

Re: Make eating all @ at the beginning of command line


From: Krzysztof Cieniuch
Subject: Re: Make eating all @ at the beginning of command line
Date: Mon, 15 Nov 2010 13:20:42 +0000
User-agent: Thunderbird 2.0.0.22 (X11/20090625)

Paul Smith wrote:
On Mon, 2010-11-15 at 12:25 +0000, Krzysztof Cieniuch wrote:
make is eating all @ characters when silencing command line
e.g.
foo: bar
    @echo "do foo"
    @@echo "do foo"
    @@@echo "do foo"
    touch foo

It doesn't matter how many @ you put up front. In above example all echo commands will be passed to shell without preceding @. Is this a bug or feature ;-)

This is intended behavior.  The POSIX spec for make is slightly
ambiguous about this but it does say:

        An execution line is built from the command line by removing ANY
        prefix characters.

(emphasis mine).  GNU make does it this way so that if you write
something like:

        COMMAND = @echo hi
        all: ; @$(COMMAND)

it works rather than giving a syntax error.  I'm sure that many
makefiles rely on this behavior whether they know it or not.

Cool I thought so it is by design. Obviously make is perfect(ed) tool :-)))

Thanks
Chris




reply via email to

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