Debugging a makefile
When make works, it’s great. When it fails, it’s awful.
A nice trick is to create a new target, right up at the top of the file where it becomes the new default target, give it no dependencies (unless you want to test the dependent build, I guess) and have it echo variables to stdout. This is how I found out that I had an extra space appended to one of my path variables, which was really screwing up make.
madness:
echo \"VAR1 is \" $(VAR1)
echo \"VAR2 is \" $(VAR2)
This was enough to solve my problem. Hope it’s useful for yours, whatever it may be.


