#
# File:         Makefile
# Date:         07.11.2004
# Author:       Topi Pohjolainen
# Description:  Makefile for constructing reachability graph for xxx-system
#               using Maria analyser
#
# These are expected from the environment:
#     WORKERS:=2
#     LOG:=log
#
ifeq ($(WORKERS),)
    WORKERS:=2
endif

ifeq ($(LOG),)
    LOG:=log
endif

TIME:=/usr/bin/time -f "$(WORKERS) %e"

all: setup.pn
	$(TIME) maria -e 'model "main.pn"; breadth; exit' >> $(LOG)

fair: fairness_constraints.pn setup.pn
	$(TIME) ./fairness.maria -DUSE_FAIRNESS_CONSTRAINTS >> $(LOG)

fairness_constraints.pn:
	./fairness.sh $(WORKERS) > $@

setup.pn:
	echo "typedef int (0..(${WORKERS} - 1)) Worker;" > $@

clean:
	rm -f *.rg[a-s] fairness_constraints.pn setup.pn log

# EOF
