When reading a profile entry remove trailing quote when there's an
[wine.git] / tools / make_debug
bloba7d8bb95ac982a39f95bf5e2e17d9a0fba42e76f
1 #!/bin/sh
3 # This script generates the required file for supporting the debug
4 # channels used throught the code.
5 # The generated file is
6 # include/debugdefs.h
7 # The script must be run in the root directory of the project.
9 # Dimitrie O. Paun <dimi@cs.toronto.edu>
10 # Patrik Stridvall <ps@leissner.se>
13 DEBUG_CHANNELS=`tools/find_debug_channels`
15 exec > include/debugdefs.h
17 cat <<EOF
18 /* Do not modify this file -- it is automatically generated! */
20 #include "debugtools.h"
22 #define DEBUG_CLASS_COUNT __DBCL_COUNT
24 #ifdef DEBUG_RUNTIME
26 const char * const debug_cl_name[] = { "fixme", "err", "warn", "trace" };
28 EOF
30 chno=0
31 for ch in $DEBUG_CHANNELS
33 echo "const int dbch_$ch = $chno;"
34 chno=`expr $chno + 1`
35 done
36 echo
37 echo "#define DEBUG_CHANNEL_COUNT $chno"
39 count=1
40 echo
41 echo 'char __debug_msg_enabled[DEBUG_CHANNEL_COUNT][DEBUG_CLASS_COUNT] = {'
42 for ch in $DEBUG_CHANNELS
44 if [ "${count}" != "${chno}" ]; then
45 echo "{1, 1, 0, 0},"
46 else
47 echo "{1, 1, 0, 0}"
49 count=`expr $count + 1`
50 done
51 echo '};'
53 count=1
54 echo
55 echo 'const char * const debug_ch_name[DEBUG_CHANNEL_COUNT] = {'
56 for ch in $DEBUG_CHANNELS
58 if [ "${count}" != "${chno}" ]; then
59 echo "\"${ch}\",";
60 else
61 echo "\"${ch}\"";
63 count=`expr $count + 1`
64 done
65 echo '};'
67 cat <<EOF
69 #endif /*DEBUG_RUNTIME*/
71 /* end of automatically generated debug.h */
72 EOF