diff options
Diffstat (limited to 'example/build.sh')
-rwxr-xr-x | example/build.sh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/example/build.sh b/example/build.sh index 172aa69..de969e8 100755 --- a/example/build.sh +++ b/example/build.sh @@ -1,7 +1,14 @@ #!/bin/sh -CFLAGS='-g -Wall' -INCLUDE='-I..' -LIBS='-lm' +compiler='gcc' +if [ $# -eq 1 ] ; then + if [ $1 = 'windows' ] ; then + compiler='x86_64-w64-mingw32-gcc' + fi +fi +cflags='-g -Wall' +include='-I..' +libs='-lm' +path=`dirname $0` set -x -#tcc $CFLAGS $INCLUDE $LIBS -o example example.c && ./example -gcc $CFLAGS $INCLUDE $LIBS -o example example.c && ./example +cd $path +$compiler $cflags $include -o example example.c $libs |