I’m not good at makefiles, so I needed a tool to help me debug some relatively simple ones.
[Wayback] Tool for debugging makefiles – Stack Overflow came to the rescue.
The suggestion in the first answer was enough: run make -n.
But the other suggestions are great too, so here I quote them (thanks [Wayback] Rob Wells and [Wayback] User Rajish):
Have you been looking at the output from runningmake -nandmake -np, and the biggiemake -nd?Are you using a fairly recent version of
gmake?Have you looked at the free chapter on [Wayback] Debugging Makefiles available on O’Reilly’s site for their excellent book “Managing Projects with GNU Make” ([Wayback] Amazon Link).
I’m sure that [Wayback] remake is what you are looking for.
From the homepage:
remake is a patched and modernized version of GNU make utility that adds improved error reporting, the ability to trace execution in a comprehensible way, and a debugger.
It has gdb-like interface and is supported by mdb-mode in (x)emacs which means breakponts, watches etc. And there’s [Wayback] DDD if you don’t like (x)emacs
The free chapter: [Wayback] https://www.oreilly.com/openbook/make3/book/ch12.pdf
Remake documentation: [Wayback] remake – GNU Make with comprehensible tracing, profiling, extended error messages, and a debugger — remake 4.3+dbg-1.4 documentation
Tutorials
[Wayback] Makefile Tutorial by Example
–jeroen




















