help-make
[Top][All Lists]
Advanced

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

Re: How to debug during make?


From: Stephan Beal
Subject: Re: How to debug during make?
Date: Tue, 25 May 2010 19:51:22 +0200

On Tue, May 25, 2010 at 9:27 AM, robert song <address@hidden> 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:
   address@hidden; \
       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/

reply via email to

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