Release coccinelle-0.2.2-rc1
[bpt/coccinelle.git] / scripts / coccicheck / configure
index ac65188..1b7e105 100755 (executable)
@@ -45,9 +45,57 @@ echo -e "\nFor efficiency, run \`<coccinelle dir>/scripts/glimpseindex_cocci.sh\
 echo -e "in $PROJECT"
 echo -e "NB: glimpse is available at http://webglimpse.net/ but it is not under the GPL.\n"
 
-sed -i "s|^PREFIX?=.*$|PREFIX?=${PREFIX}|" Makefile
-sed -i "s|^PROJECT?=.*$|PROJECT?=${PROJECT}|" Makefile
-sed -i "s|^COCCI?=.*$|COCCI?=${COCCI}|" Makefile
-sed -i "s|^RESULTS?=.*$|RESULTS?=${RESULTS}|" Makefile
-sed -i "s|^SPFLAGS?=.*$|SPFLAGS?=\"${SPFLAGS}\"|" Makefile
+cat > Makefile <<EOF
+PREFIX?=${PREFIX}
+PROJECT?=${PROJECT}
+SPFLAGS?="${SPFLAGS}"
 
+COCCI?=${COCCI}
+RESULTS?=${RESULTS}
+
+.PHONY:: update viewlog viewfilteredlog viewres checkcocci
+.PHONY:: all clean distclean depend
+
+all:
+       \$(MAKE) -C \$(RESULTS)
+
+update:
+       ./bin/update_result_tree \$(PREFIX) \$(PROJECT) \$(COCCI) \$(RESULTS) \$(SPFLAGS)
+
+viewlog:
+       find \$(RESULTS) -name "*.log" | xargs cat | pager
+
+viewfilteredlog:
+       find \$(RESULTS) -name "*.log" | xargs cat | \\
+               grep -ve "^\$\$" | \\
+               grep -v "HANDLING" | \\
+               grep -v "NOTE" | \\
+               grep -v "Unsupported form of #define" | \\
+               grep -v "no glimpse keyword inferred from snippet" | \\
+               grep -v "EXN:Common.Timeout" | \\
+               grep -v "FLOW: can't find exit or error exit:" | \\
+               grep -v "FLOW: deadcode detected:" | \\
+               grep -v "LEXER: identifier with dollar:" | \\
+               grep -v "LEXER: unrecognised symbol in char:" | \\
+               grep -v "LEXER: ZARB" | \\
+               grep -v "CFG: orphelin nodes, maybe something weird happened" | \\
+               grep -v "not worth trying" | \\
+               grep -v "MultiFound field:" | \\
+               grep -ve "(ONCE) warning: I consider .* as a constant" | \\
+               grep -ve "TYPE: header .* not found"
+
+viewres:
+       find \$(RESULTS) -name "*.out" | xargs pager
+
+checkcocci:
+       for c in \`find \$(COCCI) -name "*.cocci"\`; do spatch -parse_cocci \$\$c > /dev/null ; done
+
+clean:
+       find \$(RESULTS) -name "*.out" -delete
+       find \$(RESULTS) -name "*.log" -delete
+
+distclean:
+       rm -rf \$(RESULTS)
+
+depend: update
+EOF