Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill all aspects related to masks in the tracing interface
[simgrid.git] / src / mk_supernovae.sh
1 #! /bin/sh
2
3 file=$1
4 shift
5
6 echo "#define SUPERNOVAE_MODE 1" > $file
7 echo '#include <ctype.h>' >> $file
8 echo '#include "portable.h"' >> $file
9 echo '#include "xbt.h"' >> $file
10 for n in $@ ; do
11 #    echo "File $n"
12     if [ "X$n" = 'Xxbt/log.c' ] ; then 
13       echo "#define _simgrid_log_category__default &_simgrid_log_category__log">> $file;
14     else 
15       if grep -q 'XBT_LOG_[^ ]*DEFAULT_[^ ]*CATEGORY' $n ; then 
16         default=`grep 'XBT_LOG_[^ ]*DEFAULT_[^ ]*CATEGORY' $n|
17                  sed 's/^[^(]*(\([^,)]*\).*$/\1/'|head -n1`; 
18         echo "#define _simgrid_log_category__default &_simgrid_log_category__$default">> $file;
19       else
20         echo "/* no default category in file $n */" >> $file; 
21       fi;
22     fi;
23     echo '  #include "'$n'"' >> $file ; 
24     echo "#undef _simgrid_log_category__default">> $file; 
25     echo >> $file; 
26 done
27
28 exit 0