#! /bin/sh

exe=
mach=
mlmach=
case `uname -s` in
Linux)	tag=Linux
	st=-static
	#mach=-m32
	#mlmach=-b32
	;;
Darwin)	tag=Mac
	st=-static-libgcc
	mach=-mmacosx-version-min=10.6
	;;
CYG*)	tag=Windows
	export CC=i686-pc-cygwin-gcc
	st="-static -static-libgcc"
	exe=.exe
	;;
esac

./configure CFLAGS="-O3 -fomit-frame-pointer -ffast-math $st $mach" MCFLAGS="-st $mlmach"

make math

for file in Vegas Suave Divonne Cuhre ; do
  gzip $file$exe
  mv $file$exe.gz $file$exe-$tag.gz
done

