# SPIN - Verification Software - Version 3.0 - 1997
#
# Copyright (c) 1991-1997 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, 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

CC=gcc -g			# or any other ansi compatible c compiler
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

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 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

$(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
