bug-make
[Top][All Lists]
Advanced

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

Re: Makefile line number bug?


From: Paul Smith
Subject: Re: Makefile line number bug?
Date: Fri, 13 Nov 2015 08:11:05 -0500

On Thu, 2015-11-12 at 12:12 +0000, Jonny Grant wrote:
> Is this a bug? line numbers are output as (2), but actually they are
> different. Note that also the "Hello" is output in the wrong order.. I
> presume this may be the OS rather than GNU Make.

> $ make -f makefile.mak
> makefile.mak:2: One
> makefile.mak:2: Two
> makefile.mak:2: Three
> Hello
> 
> 
> makefile.mak (not sure if the TABs have been lost)
> all:
>         @echo Hello
>         $(warning One)
>         $(warning Two)
>         $(warning Three)

The "mis-ordering" of output is as expected.  GNU make will always
expand the entire recipe (all lines) before it tries to invoke any shell
commands.  So, all the warning functions are expanded first, before the
echo command is invoked.

Probably the line number thing is an error: clearly it would be better
if the correct line number was preserved.




reply via email to

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