Skip to content
Snippets Groups Projects
make_debug 1.33 KiB
Newer Older
  • Learn to ignore specific revisions
  • Alexandre Julliard's avatar
    Alexandre Julliard committed
    #
    
    # This script generates the required file for supporting the debug
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    # channels used throught the code.
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    #   include/debugdefs.h
    # The script must be run in the root directory of the project.
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    #
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    # Dimitrie O. Paun <dimi@cs.toronto.edu>
    
    # Patrik Stridvall <ps@leissner.se>
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    #
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    DEBUG_CHANNELS=`tools/find_debug_channels`
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    exec > include/debugdefs.h
    
    cat <<EOF
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    /* Do not modify this file -- it is automatically generated! */
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    #include "debugtools.h"
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    #define DEBUG_CLASS_COUNT __DBCL_COUNT
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    const char * const debug_cl_name[] = { "fixme", "err", "warn", "trace" };
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    EOF
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    chno=0
    for ch in $DEBUG_CHANNELS
    do
        echo "int dbch_$ch = $chno;"
        chno=`expr $chno + 1`
    done
    echo
    echo "#define DEBUG_CHANNEL_COUNT $chno"
    
    count=1
    echo
    
    echo 'char __debug_msg_enabled[DEBUG_CHANNEL_COUNT][DEBUG_CLASS_COUNT] = {'
    
    for ch in $DEBUG_CHANNELS
    do
        if [ "${count}" != "${chno}" ]; then
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    	echo "{1, 1, 0, 0},"
    
        else
    	echo "{1, 1, 0, 0}"
        fi
        count=`expr $count + 1`
    done
    echo '};'
    
    count=1
    echo
    echo 'const char * const debug_ch_name[DEBUG_CHANNEL_COUNT] = {'
    for ch in $DEBUG_CHANNELS
    do
        if [ "${count}" != "${chno}" ]; then
    	echo "\"${ch}\",";
        else
        echo "\"${ch}\"";
        fi
        count=`expr $count + 1`
    done
    echo '};'
    
    cat <<EOF
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    #endif /*DEBUG_RUNTIME*/
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    
    
    Alexandre Julliard's avatar
    Alexandre Julliard committed
    /* end of automatically generated debug.h */
    EOF