summaryrefslogtreecommitdiff
path: root/example/build.sh
blob: e6cee7c57bdd16779037824fa15698398bddd342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
compiler='gcc'
path=`dirname $0`
cd $path
if [ $# -eq 1 ] ; then 
	if [ $1 = 'windows' ] ; then
		compiler='x86_64-w64-mingw32-gcc'
	fi
	if [ $1 = 'clean' ] ; then
		set -x
		rm -f macros macros.exe arena arena.exe sys sys.exe string string.exe
		exit
	fi
fi
cflags='-g -Wall'
include='-I..'
libs='-lm'
set -x
$compiler $cflags $include -o macros macros.c $libs
$compiler $cflags $include -o arena arena.c $libs
$compiler $cflags $include -o sys sys.c $libs
$compiler $cflags $include -o string string.c $libs