# SPIN - Verification Software - Version 3.4.2 - October 2000
#
# Copyright (c) 1991-2000 by Lucent Technologies - Bell Laboratories
# All Rights Reserved.  This software is for educational purposes only.
# No guarantee is expressed or implied by the distribution of this code.
#
# The SPIN software is written by Gerard J. Holzmann, originally as part
# of ``Design and Validation of Protocols,'' ISBN 0-13-539925-4,
# 1991, Prentice Hall, Englewood Cliffs, NJ, 07632
# Send bug-reports and/or questions to: gerard@research.bell-labs.com
# The book is available frm www.amazon.com

CC=cc -g		# or any other ansi compatible c compiler
# CC=cc -g -DNXT	# if you need the X operator in LTL
CFLAGS=-ansi -D_POSIX_SOURCE	# on some systems add: -I/usr/include

#	on Solaris:	add -DSOLARIS
#	on PCs:		add -DPC
#	on HP-UX machines, use: CFLAGS=-Aa -D_POSIX_SOURCE
#	and add $(CFLAGS) to the spin.o line: $(CC) $(CFLAGS) -c y.tab.c
#	for __FreeBSD__ delete -D_POSIX_SOURCE
#
#	if all else fails, try compiling spin as:
#		yacc -v -d spin.y
#		cc -D...  -o spin  *.c

YACC=yacc		# on Solaris: /usr/ccs/bin/yacc
YFLAGS=-v -d 		# create y.output, and y.tab.h

SPIN_OS= spin.o spinlex.o sym.o vars.o main.o ps_msc.o \
	mesg.o flow.o sched.o run.o pangen1.o pangen2.o \
	pangen3.o pangen4.o pangen5.o guided.o dstep.o \
	structs.o pc_zpp.o

TL_OS=	tl_parse.o tl_lex.o tl_main.o tl_trans.o tl_buchi.o \
	tl_mem.o tl_rewrt.o tl_cache.o

spin:	$(SPIN_OS) $(TL_OS)
	$(CC) $(CFLAGS) -o spin $(SPIN_OS) $(TL_OS)

spin.o:	spin.y
	$(YACC) $(YFLAGS) spin.y
	$(CC) -c y.tab.c
	rm -f y.tab.c
	mv y.tab.o spin.o

$(SPIN_OS): spin.h

pangen5.o:	pan_ast.c

$(TL_OS): tl.h

main.o pangen2.o ps_msc.o: version.h
pangen1.o: pangen1.h pangen3.h
pangen2.o: pangen2.h pangen4.h pangen5.h

clean:
	rm -f spin *.o y.tab.[ch] y.output y.debug spin.c
	rm -f pan.[chmotb] a.out core
