#!/bin/sh
# SPIN - Verification Software - Version 5.1 - November 2007
#
# Tool documentation: http://spinroot.com/
# bug-reports: bugs@spinroot.com            

# This script is for compiling Spin on a PC with a Unix shell
# It requires 3 things to be installed on your system:
#	cygwin (for sh, bison yacc, echo, mv, and rm)
#	either gcc or the Visual C++ compiler (cl)
# On a 2.5GHz system everything compiles in under 1 second.
# See also makefile for compiling Spin on a standard Unix/Linux system.

# CC="gcc"
# CFLAGS="-DPC -DNXT -O1 -Wall -ansi -w -o spin.exe"

CC="cl"	# Visual Studio for a standalone compilation
CFLAGS="-DPC -DNXT -DWIN32 -D_CONSOLE -O2 -Zp4 -nologo -wd4996 -Wp64 -Fespin.exe"

yacc -v -d spin.y

# compile for 32 or 64 bits:
  $CC -DWIN32 $CFLAGS *.c
# $CC -DWIN64 $CFLAGS *.c bufferoverflowu.lib

rm -f *.o *.obj
rm -f y?tab.? y.output

# install in the usual place on cygwin:
echo "mv spin.exe /usr/bin"
mv spin.exe /usr/bin
