1b7e105bffa5ea58fe0d23358e1c8315934ff199
6 if [ "$MODE" == "" -o "$PROJECT" == "" ]; then
7 echo -e "\n\tUsage: $0 mode path\n"
8 echo -e "\tmode\torg or diff according to your needs"
9 echo -e "\tpath\tyour project path\n"
13 SPATCHVER
=`spatch -version 2>&1 | sed "s|spatch version \([^ ]*\) .*|\1|"`
14 WITHPYTHON
=`spatch -version 2>&1 | sed "s|spatch version \([^ ]*\) with Python support|yes|"`
15 WITHPYTHON
=`echo $WITHPYTHON | sed "s|spatch version \([^ ]*\) without Python support||"`
17 echo "Using spatch version $SPATCHVER"
18 #TODO: Add version check
20 if [ "$WITHPYTHON" ] ; then
21 echo "Your version has been build with Python support"
23 echo "Your version has no Python support"
24 if [ "org" == "$MODE" ] ; then
25 echo "org mode requires Python support."
31 echo "Using PREFIX="${PREFIX:=`pwd`}
32 echo "Using PROJECT="${PROJECT:=$PREFIX/project}
33 echo "Using COCCI="${COCCI:=$PREFIX/cocci}
34 echo "Using RESULTS="${RESULTS:=$PREFIX/results}
36 if [ "`which glimpse`" ]; then
37 FLAGS
=${SPFLAGS:="-timeout 60 -use_glimpse"}
39 FLAGS
=${SPFLAGS:="-timeout 60"}
41 SPFLAGS
="$FLAGS -D $MODE"
42 echo "Using SPFLAGS="$SPFLAGS
44 echo -e "\nFor efficiency, run \`<coccinelle dir>/scripts/glimpseindex_cocci.sh\`"
46 echo -e "NB: glimpse is available at http://webglimpse.net/ but it is not under the GPL.\n"
56 .PHONY:: update viewlog viewfilteredlog viewres checkcocci
57 .PHONY:: all clean distclean depend
60 \$(MAKE) -C \$(RESULTS)
63 ./bin/update_result_tree \$(PREFIX) \$(PROJECT) \$(COCCI) \$(RESULTS) \$(SPFLAGS)
66 find \$(RESULTS) -name "*.log" | xargs cat | pager
69 find \$(RESULTS) -name "*.log" | xargs cat | \\
71 grep -v "HANDLING" | \\
73 grep -v "Unsupported form of #define" | \\
74 grep -v "no glimpse keyword inferred from snippet" | \\
75 grep -v "EXN:Common.Timeout" | \\
76 grep -v "FLOW: can't find exit or error exit:" | \\
77 grep -v "FLOW: deadcode detected:" | \\
78 grep -v "LEXER: identifier with dollar:" | \\
79 grep -v "LEXER: unrecognised symbol in char:" | \\
80 grep -v "LEXER: ZARB" | \\
81 grep -v "CFG: orphelin nodes, maybe something weird happened" | \\
82 grep -v "not worth trying" | \\
83 grep -v "MultiFound field:" | \\
84 grep -ve "(ONCE) warning: I consider .* as a constant" | \\
85 grep -ve "TYPE: header .* not found"
88 find \$(RESULTS) -name "*.out" | xargs pager
91 for c in \`find \$(COCCI) -name "*.cocci"\`; do spatch -parse_cocci \$\$c > /dev/null ; done
94 find \$(RESULTS) -name "*.out" -delete
95 find \$(RESULTS) -name "*.log" -delete