#
#	This makefile builds several benchmarks for UNIX
#	
#	The BYTE magazine benchmarks are here, as well as iocall,
#	which came off Usenet, and Dhrystone.
#
#	type:	make		#to build all the programs
#		make run	#to run all of the benchmarks
#
#		make run >results 2>&1
#		make report		#Generates handy summary
#
#	collected by Rick Richardson, PC Research, Inc. (201) 922-1134
#		..!ihnp4!houxm!castor!pcrat!rer
#	NOTE:	send me the Dhrystone benchmarks results for any new machine
#		I'll summarize for the next release of dhrystone.
#
SHELL=/bin/sh
FILES=	makefile dry.README\
	dread.c   fcall.c   float.c   iocall.c loop.c    pipes.c   sieve.c \
	tst.sh dwrite.c fibo.c    iofile.c  multi.sh  scall.c   bytesort.c \
	dry.c dryresults.sh gen_rpt
BYTE=	dwrite dread fcalla fcalle fibo float iofile loop pipes scall \
	sieve bytesort
USENET=	iocall
DRY=	dryr drynr
CMDS=	$(BYTE) $(USENET) $(DRY)
#
#	-z/-i flags are recommended for Venix
#
CFLAGS=-O -s
#CFLAGS=-O -s -i -z

all:	$(BYTE) $(USENET) $(DRY)

clobber:
	-rm -f $(BYTE) $(USENET) $(DRY)

bench.shar:	$(FILES)
	shar $(FILES) > $@
fcalle: fcall.c
	cc $(CFLAGS) -DEMPTY fcall.c -o $@
fcalla: fcall.c
	cc $(CFLAGS) -DASSIGN fcall.c -o $@
bytesort:	bytesort.c
	cc -s -O -i bytesort.c -o $@
dryr:	dry.c
	cc $(CFLAGS) -DREG=register dry.c -o $@
drynr:	dry.c
	cc $(CFLAGS) dry.c -o $@

run:	shells
	for i in $(CMDS); do echo "$$i:"; time $$i; done
	@rm -f rfile

report:	results
	gen_rpt results report

shells:
	time $(SHELL) tst.sh
	time $(SHELL) multi.sh 1
	time $(SHELL) multi.sh 1 2
	time $(SHELL) multi.sh 1 2 3
	time $(SHELL) multi.sh 1 2 3 4
	time $(SHELL) multi.sh 1 2 3 4 5
