#-----------------------------------------------------------------------------#

main_target: check

include ../Mmake.common

#-----------------------------------------------------------------------------#

# uncomment the following lines to test the performance
# of the benchmarks (with I/O suppressed)
# C2INITFLAGS=-w "`extract $(*:_init=) '' BenchEntry`"
# MLFLAGS=-- -static

#-----------------------------------------------------------------------------#

ifeq ($(HAVE_NUPROLOG),yes)
%.exp: %.nu
	{ [ -f $*.inp ] && cat $*.inp; } | ./$< > $@ 2>&1;
endif

#-----------------------------------------------------------------------------#

PROGS=	\
	cqueens \
	crypt \
	deriv \
	deriv2 \
	nrev \
	poly \
	primes \
	qsort \
	queens \
	query \
	tak

DEPENDS=$(PROGS:%=%.depend)
DEPS=	$(PROGS:%=%.dep)
OUTS=	$(PROGS:%=%.out)
EXPS=	$(PROGS:%=%.exp)
RESS=	$(PROGS:%=%.res)
SS=	$(PROGS:%=%.s)
CS=	$(PROGS:%=%.c)

dep:	$(DEPS)

depend:	$(DEPENDS)

exp:	$(EXPS)

check:	$(OUTS) $(RESS)

outs:	$(OUTS)

cs:	$(CS)

ss:	$(SS)

all:	$(PROGS)

dir.%:	$(PROGS) $(SS)
	-mkdir $@
	cp $(PROGS) $(SS) $@
	cp BenchEntry $@

#-----------------------------------------------------------------------------#
