9cd9ce6468baafdbda7a5a9c5f295bfd5600bbe5
[bpt/coccinelle.git] / scripts / coccicheck / configure
1 #!/bin/bash
2
3 MODE=$1
4 PROJECT=$2
5
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"
10 exit 1
11 fi
12
13 echo "Using PREFIX="${PREFIX:=`pwd`}
14 echo "Using PROJECT="${PROJECT:=$PREFIX/project}
15 echo "Using COCCI="${COCCI:=$PREFIX/cocci}
16 echo "Using RESULTS="${RESULTS:=$PREFIX/results}
17 echo "Using SPFLAGS="${SPFLAGS:="-timeout 60 -use_glimpse -D $MODE"}
18
19 echo -e "\nFor efficiency, run \`<coccinelle dir>/scripts/glimpseindex_cocci.sh\`"
20 echo -e "in $PROJECT\n"
21
22 sed -i "s|^PREFIX?=.*$|PREFIX?=${PREFIX}|" Makefile
23 sed -i "s|^PROJECT?=.*$|PROJECT?=${PROJECT}|" Makefile
24 sed -i "s|^COCCI?=.*$|COCCI?=${COCCI}|" Makefile
25 sed -i "s|^RESULTS?=.*$|RESULTS?=${RESULTS}|" Makefile
26 sed -i "s|^SPFLAGS?=.*$|SPFLAGS?=\"${SPFLAGS}\"|" Makefile
27