Monday 9 February 2009

Debugging Makefiles

Debugging makefiles is hard work, and makefiles that make extensive use of @ to hide invoked commands make it hard to see what command failed.

Dr Dobbs has some useful tips http://www.ddj.com/development-tools/197003338 from which I derive the simple solution to my problem, to use /bin/sh -x as SHELL; i.e.

make SHELL='/bin/sh -x'

then the shell will print out the invoked commands, even if make won't!

No comments:

Post a Comment