On Sun, 2010-08-29 at 14:13 -0400, Paul Smith wrote: > On Sun, 2010-08-22 at 15:05 +0000, e...@opera.com wrote: > > Quoting Edward Peschko <e...@yahoo-inc.com>: > > > My question - how do you actually trace this back to the target that > > > generated this statement? In this case, the ghostscript Makefile is > > > so convoluted that it goes through levels of indirection to get to > > > this point, so grep is of limited help here. > > > > > > So - why can't make add (optionally, of course) a line number/file > > > name combo to each of the statements that it executes - and as an > > > additional option show the text of the makefile that is executing at > > > the time? > > > > See recent thread: > > http://lists.gnu.org/archive/html/bug-make/2010-07/msg00159.html > > http://lists.gnu.org/archive/html/bug-make/2010-08/msg00002.html > > > > Summary: > > The feature you describe would indeed be a nice thing to add. > > It's possible to simulate it at present if your make-files are nicely > > written, but tiresome if you're dealing with someone else's make files > > that didn't contemplate the need to do this. > > In GNU make 3.82 if you enable "basic" debugging (that is, any level of > debugging including --debug=b) you will see information on where the > command was defined (makefile and linenumber); for example from a build > of GNU make itself, with --debug=b:
I decided this was not so great. I've implemented (in CVS now) a new flag, --trace, which does two things: first, it always shows the complete recipe even for recipes that are marked as silent. Second, it shows a reference line for each rule that's run in the standard GNU format: <filename>:<lineno>: update target `<target>' due to: $+ Or: <filename>:<lineno>: target `<target>' does not exist For builtin rules, the filename/linenumber is replaced with "<builtin>". This way, you can use tools that can parse the standard GNU output to jump from place to place. -- ------------------------------------------------------------------------------- Paul D. Smith <psm...@gnu.org> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make