# Makefile to produce the blif and the object code files from the
# esterel source programs. This makefile needs the esterel compiler
# and a standard C compiler. Files to produce are normally already in
# the directory and can be regenerated if you have the esterel compiler.
# If not, do and see URL "http://cma.cma.fr/Esterel/" to get it.

# Tools and Commands

CC		=	cc
ESTEREL		=	esterel

RM		= 	rm -f
# Files

STRL_FILES	=	arbiter4.strl \
			obs-arb4.strl

# Rules

simple-verif: arbiter4.blif arbiter4.o
	@echo "Calling Xeve..."
	@xeve arbiter4.blif &
	@echo "Calling Xes..."
	@xes arbiter4.o &

obs-verif: obs-arb4.blif obs-arb4.o
	@echo "Calling Xeve..."
	@xeve obs-arb4.blif &
	@echo "Calling Xes..."
	@xes obs-arb4.o &


arbiter4.blif: $(STRL_FILES)
	$(ESTEREL) -causal -Lblif arbiter4.strl

arbiter4.o:  arbiter4.c
	$(CC) -c arbiter4.c

arbiter4.c:  $(STRL_FILES)
	$(ESTEREL) -I -simul arbiter4.strl

obs-arb4.blif: $(STRL_FILES)
	$(ESTEREL) -causal -Lblif $(STRL_FILES) -B obs-arb4

obs-arb4.o:  obs-arb4.c
	$(CC) -c obs-arb4.c

obs-arb4.c:  $(STRL_FILES)
	$(ESTEREL) -I -simul $(STRL_FILES) -B obs-arb4

clean:
	$(RM) *.c *.o *.blif
