Is there a Make debugger? I need to find out someone else makefile

I need to add some features to a very complex multi-level make file (many included files, many goals, many variables) that were written by someone else, which, of course, no longer works with the company. There are people here who understand some of them, but not all.

Is there a Make debugger in which I can take one step through it, or some equivalent way to track the execution through many files and the goals that are being compiled? Or is there some other way to deal with how this works?

+4
source share
2 answers

GNU Make has various options for printing some debugging information at run time. -d prints all debugging information; maybe too much, and maybe not what you need, but you can try to sift it. There are also options, such as -n to run a dry run, -p to print a rule database, -w to print the directory you are in to track problems in complex recursive entries and --warn-undefined-variables to track certain problems with variables.

If none of this works, you can try Remake , which claims to be a fixed GNU make with a debugger. I haven't used it, but from the documentation , it looks like this might help you, and it has some more tips on trying to track errors in the Makefile.

+2
source

You can see this article http://oreilly.com/catalog/make3/book/ch12.pdf (chapter "Debugging Make Files" by Oreilly "Project Management with GNU Make, Third Edition")

+2
source

All Articles