3 # This script scans the whole source code for symbols of the form dprintf_xxx,
4 # generates the necessary macro definitions and puts them into the files
5 # include/stddebug.h and include/debug.h . This script must be started with
6 # cwd = rootdir of the Wine-distribution.
8 # Michael Patra <micky@marie.physik.tu-berlin.de>
10 makedepend
-s"# /* Do not remove this line or change anything below this line */" -finclude/debug.h
11 echo " " >> include
/debug.h
12 grep -h dprintf_
*/*.c |
tr -d '[:blank:]' | cut
-d"(" -f1 |
sort |
uniq | \
13 cut
-d"_" -f2 > temp.$$
14 echo " " >> include
/debug.h
15 echo "#ifdef DEBUG_NONE_EXT" >> include
/debug.h
20 y
=`echo $x | tr a-z A-Z`
21 echo "#undef DEBUG_$y" >> include
/debug.h
24 echo "#endif" >> include
/debug.h
25 echo " " >> include
/debug.h
26 echo " " >> include
/debug.h
27 echo "#ifdef DEBUG_ALL_EXT" >> include
/debug.h
32 y
=`echo $x | tr a-z A-Z`
33 echo "#define DEBUG_$y" >> include
/debug.h
36 echo "#endif" >> include
/debug.h
37 echo " " >> include
/debug.h
38 echo " " >> include
/debug.h
39 echo "#ifdef DEBUG_RUNTIME" >> include
/debug.h
40 echo "#ifdef DEBUG_DEFINE_VARIABLES" >> include
/debug.h
41 echo "short debug_msg_enabled[]={" >> include
/debug.h
47 y
=`echo $x | tr a-z A-Z`
48 echo "#ifdef DEBUG_$y" >> include
/debug.h
49 echo "1," >> include
/debug.h
50 echo "#else" >> include
/debug.h
51 echo "0," >> include
/debug.h
52 echo "#endif" >> include
/debug.h
55 echo "0};" >> include
/debug.h
56 echo "#else" >> include
/debug.h
57 echo "extern short debug_msg_enabled[];" >> include
/debug.h
58 echo "#endif" >> include
/debug.h
59 echo "#endif" >> include
/debug.h
60 echo " " >> include
/debug.h
61 echo " " >> include
/debug.h
67 y
=`echo $x | tr a-z A-Z`
68 echo "#ifdef DEBUG_RUNTIME" >> include
/debug.h
69 echo "#define dprintf_$x if(debug_msg_enabled[$i]) fprintf" >> include
/debug.h
70 echo "#else" >> include
/debug.h
71 echo "#ifdef DEBUG_$y" >> include
/debug.h
72 echo "#define dprintf_$x fprintf" >> include
/debug.h
73 echo "#else" >> include
/debug.h
74 echo "#define dprintf_$x" >> include
/debug.h
75 echo "#endif" >> include
/debug.h
76 echo "#endif" >> include
/debug.h
77 echo " " >> include
/debug.h
81 makedepend
-s"# /* Do not remove this line or change anything below this line */" -finclude/stddebug.h
82 echo " " >> include
/stddebug.h
83 echo "#ifdef DEBUG_NONE" >> include
/stddebug.h
88 y
=`echo $x | tr a-z A-Z`
89 echo "#undef DEBUG_$y" >> include
/stddebug.h
92 echo "#endif" >> include
/stddebug.h
93 echo " " >> include
/stddebug.h
94 echo " " >> include
/stddebug.h
95 echo "#ifdef DEBUG_ALL" >> include
/stddebug.h
100 y
=`echo $x | tr a-z A-Z`
101 echo "#define DEBUG_$y" >> include
/stddebug.h
104 echo "#endif" >> include
/stddebug.h
105 echo " " >> include
/debug.h
106 echo " " >> include
/debug.h
107 echo "#ifdef DEBUG_RUNTIME" >> include
/debug.h
108 echo "#ifdef DEBUG_DEFINE_VARIABLES" >> include
/debug.h
109 echo "static char *debug_msg_name[] = {" >> include
/debug.h
114 echo "\"$x\"," >> include
/debug.h
117 echo "\"\"};" >> include
/debug.h
118 echo "#endif" >> include
/debug.h
119 echo "#endif" >> include
/debug.h