Subject: Re: make: print real reason for exec failure
To: Tim Rightnour <root@garbled.net>
From: Simon J. Gerraty <sjg@quick.com.au>
List: tech-toolchain
Date: 05/30/2001 23:30:29
>One thing I have manually hacked into make on occasion is to run sh -x instead
>of sh when debugging particularly messy makefiles. It would be kinda neat if
>a debug option to make could be added to do something like this.
Yes, though that might be a bit of a sledge hammer?
I've used something like ${SHELL_TRACE:Dset -x;} at the start of said
hairy bits of Makefiles, and then one can do "make SHELL_TRACE=yes"
to get sh -x output.
You can use any number of such variables to be able to selectively turn
on tracing in various parts.
I also find say DEBUG_ECHO?=:, then you can just put
@${DEBUG_ECHO} this is debug info .TARGET=${.TARGET} etc
in the scipt and use "make DEBUG_ECHO=echo" to turn it on.
--sjg