File: make_debug

package info (click to toggle)
wine 0.0.980315-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 10,136 kB
  • ctags: 26,112
  • sloc: ansic: 156,310; makefile: 1,160; yacc: 807; perl: 655; lex: 555; sh: 304
file content (90 lines) | stat: -rwxr-xr-x 1,766 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
#
# This script generates the required files for supporting the debug
# channels used throught the code.
# The generated files are 
#   include/debugdefs.h
#   include/debug.h
# The script must be run in the root directory of the project.
#
# Dimitrie O. Paun <dimi@cs.toronto.edu>
#
DEBUG_H="include/debug.h"
DEBUG_DEFS_H="include/debugdefs.h"

DEBUG_CHANNELS="$( tools/find_debug_channels )"
DEBUG_CLASSES="fixme err warn trace"

{
    cat <<EOF
/* Do not modify this file -- it is automatically generated! */

#ifndef __WINE_DEBUGTOOLS_H
#include "debugtools.h"
#endif

EOF
    echo "/* Definitions for channels identifiers */"

    chno=0
    for ch in $DEBUG_CHANNELS
    do
	echo "#define dbch_${ch} $chno"
	let chno=$chno+1
    done

    echo "/* Definitions for classes identifiers */"
    clno=0
    for cl in $DEBUG_CLASSES
    do
	echo "#define dbcl_${cl} $clno"
	let clno=$clno+1
    done
} > $DEBUG_H

# Now, on the last step, we proceed to construct
# the definitions to be used by the main function.
# These will be stored in include/debugdefs.h
{
    cat <<EOF
/* Do not modify this file -- it is automatically generated! */

#ifndef __WINE_DEBUGTOOLS_H
#include "debugtools.h"
#endif

#define DEBUG_CHANNEL_COUNT $chno
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
EOF

    for ch in $DEBUG_CHANNELS
    do
	echo "{1, 1, 0, 0},"
    done
    echo '};'

    echo 'const char* debug_ch_name[] = {'
    for ch in $DEBUG_CHANNELS
    do
	echo "\"${ch}\","
    done
    echo '};'
    
    echo 'const char* debug_cl_name[] = {'
    for ch in $DEBUG_CLASSES
    do
	echo "\"${ch}\","
    done
    echo '};'

    cat <<EOF

#endif /*DEBUG_RUNTIME*/

/* end of automatically generated debug.h */
EOF

} > $DEBUG_DEFS_H