In big projects that use Make, it can be hard to examine how a make build is working and to diagnose a build problem. Imagine my joy when I finally discovered ReMake. This is a debugger, you heard it right, built off a version of GNU Make. It essentially allows you to step through a make build just like you would step through a program using GDB and examine state at any point in time.
- Installing remake is easy on Ubuntu:
$ sudo apt install remake
- Using remake is as easy as replacing your make command with it:
$ remake $ remake some_target
- If you want a verbose output of what is happening with your build use
$ remake -x
- To actually debug a build with its debugger:
$ remake -X
The debugger jumps and waits at the line with the target that it needs to execute first. Use the help command to get a list of commands that you can use. They are all similar to GDB: step to step into, next to execute next line, print to print values of make variables (this is a lifesaver!) and so on.
Tried with: remake 3.82 and Ubuntu 16.04