| # This script generates the required file for supporting the debug |
| # channels used throught the code. |
| # The script must be run in the root directory of the project. |
| # Dimitrie O. Paun <dimi@cs.toronto.edu> |
| # Patrik Stridvall <ps@leissner.se> |
| DEBUG_CHANNELS=`tools/find_debug_channels` |
| exec > include/debugdefs.h |
| /* Do not modify this file -- it is automatically generated! */ |
| #define DEBUG_CLASS_COUNT __DBCL_COUNT |
| static const char * const debug_cl_name[] = { "fixme", "err", "warn", "trace" }; |
| for ch in $DEBUG_CHANNELS |
| echo "char dbch_$ch[] = \"\\003$ch\";" |
| echo "#define DEBUG_CHANNEL_COUNT $chno" |
| echo 'static char * const debug_channels[DEBUG_CHANNEL_COUNT] = {' |
| for ch in $DEBUG_CHANNELS |
| if [ "${count}" != "${chno}" ]; then |
| for cls in err fixme warn trace |
| int dbg_header_$cls( const char *dbg_channel, const char *func ) |
| return dbg_printf( "$cls:%s:%s ", dbg_channel + 1, func ); |