# SPIN - Protocol Validation Software - Version 2.0 - January 1995
#
# Copyright (c) 1991,1995 AT&T Corporation.  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.att.com

CC=cc				# or gcc
CFLAGS=-ansi -D_POSIX_SOURCE	# maye have to add: -I/usr/include
# on HP-UX machines, use: CFLAGS=-Aa -D_POSIX_SOURCE

YACC=/usr/bin/yacc
YFLAGS=-v -d 	# create y.output, y.debug, and y.tab.h

OFILES= spin.o spinlex.o sym.o vars.o main.o \
	mesg.o flow.o sched.o run.o pangen1.o pangen2.o \
	pangen3.o pangen4.o guided.o dstep.o structures.o

spin:	$(OFILES)
	$(CC) $(CFLAGS) -o spin $(OFILES) -lm

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

$(OFILES): spin.h

pangen1.o: pangen1.c pangen1.h pangen3.h
pangen2.o: pangen2.c pangen2.h

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