forked from smart-tool/smart
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·49 lines (49 loc) · 1.49 KB
/
build.sh
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
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
set -e
./logo
CC="${CC:-gcc}"
MACHINE="$(uname -m)"
ARCH="$($CC -dumpmachine | cut -f1 -d-)"
if [ $ARCH = x86_64 ]
then
CFLAGS="-march=native -mtune=native"
SSE2="-msse2"
fi
if [ $MACHINE = x86_64 ]
then
# we don't care that much about windows non-compat warnings yet
uname_s="$(uname -s)"
case "$uname_s" in
MINGW*) ;;
CYGWIN*) ;;
MSYS_NT*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
BINDIR=bin
DRV=
if [ "$ARCH" != "$MACHINE" ]; then
echo cross complation to $MACHINE on $ARCH
CROSS=1
CFLAGS="-Wall"
BINDIR=bin/$ARCH
DRV="qemu-$ARCH "
fi
echo " Compiling algocfg.c................................[OK]"
$CC source/algocfg.c -O2 $CFLAGS -o algocfg
echo " Compiling smart.c..................................[OK]"
$CC source/smart.c -O3 $CFLAGS $SSE2 -o smart -lm -std=gnu99 -DBINDIR="\"$BINDIR\""
echo " Compiling show.c...................................[OK]"
$CC source/show.c -O2 $CFLAGS -o show
echo " Compiling selectAlgo.c.............................[OK]"
$CC source/selectAlgo.c -O2 $CFLAGS -o select -DBINDIR="\"$BINDIR\""
echo " Compiling test.c...................................[OK]"
$CC source/test.c -O3 $CFLAGS -o test -DBINDIR="\"$BINDIR\""
echo " Generating random text buffers....................."
$CC source/textgen.c -o textgen -std=gnu99
$DRV./textgen
echo " Compiling all string matching algorithms..........."
$CC source/compilesm.c -o compilesm -std=gnu99 -DBINDIR="\"$BINDIR\""
$DRV./compilesm $@
echo " "
echo " "