On Tue, May 25, 2010 at 9:27 AM, robert song <[email protected]>wrote:

> I found it hard to debug the error messge during make.
> Now I only know one method is to use SHELL="sh -x".
> But is there any way to print out the line information or other info
> in details?
>

to Make, the line numbers for shell commands are not necessarily intuitive:

foo:
    @command; \
       othercommand; \
       yetAnotherCommand

that script is ONE line long.

The BASH shell hash a variable called $LINENO (i _think_ that's the name)
which gives the current script line number, but it won't help you in this
case (it will always say Line 1). In fact, in Makefiles it would always
report line #1, e.g.:

foo:
    command 1
    command 2
    command 3

those are 3 different commands, each starting on line 1 of their embedded
script.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to