Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make example dot if graphviz is enable and if it is possible.
[simgrid.git] / src / mk_supernovae.sh
1 #! /bin/sh
2
3 file=$1
4 shift
5
6 cat > $file <<EOF
7 #define SUPERNOVAE_MODE 1
8 #ifndef _GNU_SOURCE
9 #  define _GNU_SOURCE   /* for getline() with older libc */
10 #endif
11 #include <ctype.h>
12 #include "portable.h"
13 #include "xbt.h"
14 EOF
15 for n in $@ ; do
16 #    echo "File $n"
17     if [ "X$n" = 'Xxbt/log.c' ] ; then 
18       echo "#define _simgrid_log_category__default &_simgrid_log_category__log">> $file;
19     else 
20       if grep -q 'XBT_LOG_[^ ]*DEFAULT_[^ ]*CATEGORY' $n ; then 
21         default=`grep 'XBT_LOG_[^ ]*DEFAULT_[^ ]*CATEGORY' $n|
22                  sed 's/^[^(]*(\([^,)]*\).*$/\1/'|head -n1`; 
23         echo "#define _simgrid_log_category__default &_simgrid_log_category__$default">> $file;
24       else
25         echo "/* no default category in file $n */" >> $file; 
26       fi;
27     fi;
28     echo '  #include "'$n'"' >> $file ; 
29     echo "#undef _simgrid_log_category__default">> $file; 
30     echo >> $file; 
31 done
32
33 exit 0