forked from marijnheule/microsat
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·38 lines (38 loc) · 722 Bytes
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
debug=no
while [ $# -gt 0 ]
do
case $1 in
-h) echo "usage: configure [-g | -h]"; exit 0;;
-g) debug=yes;;
esac
shift
done
[ "$CC" ] || CC=gcc
if [ ! "$CFLAGS" ]
then
case $CC in
gcc*|clang*)
CFLAGS="-Wall"
[ $debug = yes ] && CFLAGS="$CFLAGS -g3"
[ $debug = no ] && CFLAGS="$CFLAGS -O3"
;;
*)
CFLAGS="-W"
[ $debug = yes ] && CFLAGS="$CFLAGS -g"
[ $debug = no ] && CFLAGS="$CFLAGS -O"
;;
esac
fi
CFLAGS="$CFLAGS -DVERSION=\\\"`cat VERSION`\\\""
echo Version: `cat VERSION`
rm -f makefile
cat > makefile <<EOF
microsat: microsat.c makefile
$CC $CFLAGS -o microsat microsat.c
install: microsat
chmod +x microsat
cp microsat /usr/local/bin
clean:
rm -f microsat makefile
EOF