#
###########################################################################

# set this to your domain name -- ie, if this is appended to the hostname,
# you'll get a fully-qualified hostname. If you don't set this, some of
# the "testlib" permissions tests will fail.
#
HOST_DOMAIN=	iona.ie

# A good POSIX-compliant Bourne shell implementation... use "ksh" or "bash"
# if the tests give the error message "no such printer waiting".
#
SHELL=/bin/sh
# SHELL=/bin/posix/sh

###########################################################################

FIXCMD=src/fix-files $(HOST_DOMAIN)

###########################################################################

all: configs reminder

configs: test.cf printcap printer_perms perms.tst pcap.tst testlib.cf spool

test.cf: src/test.cf.sed
	$(FIXCMD) src/test.cf.sed

printcap: src/printcap.sed
	$(FIXCMD) src/printcap.sed

printer_perms: src/permfile.sed
	$(FIXCMD) src/permfile.sed:printer_perms

perms.tst: src/perms.tst
	$(FIXCMD) src/perms.tst

pcap.tst: src/pcap.tst
	$(FIXCMD) src/pcap.tst

testlib.cf: src/testlib.cf
	$(FIXCMD) src/testlib.cf

spool:
	mkdir spool
	bin/checkpc -f

reminder:
	$(FIXCMD) src/message:-

clean:
	-rm -f spool/*/core spool/*/cf* spool/*/df* spool/*/tf*
	-rm -f test.cf printcap printer_perms perms.tst pcap.tst
	-rm -rf testlib.cf failed doc.ascii.tmp*

###########################################################################
# actually perform the tests!

tests: configs lib lpr basic remote multi banners

lib: bin/testlib
	testlib `cat testlib.cf`

basic: src/t/basic
	$(SHELL) src/t/basic

remote: src/t/remote
	$(SHELL) src/t/remote

banners: src/t/banners
	$(SHELL) src/t/banners

multi: src/t/multi
	$(SHELL) src/t/multi

lpr: src/t/lpr
	$(SHELL) src/t/lpr
