# Makefile to set up /tmp directories for testing
# Tue Mar  8 11:49:43 CST 1988 Patrick Powell
# This Makefile assumes that ${BIN}/checkpc exists, as it uses it
# $Header: Makefile,v 3.2 88/06/29 09:35:30 papowell Locked $
# $Log:	Makefile,v $
# Revision 3.2  88/06/29  09:35:30  papowell
# fixed clean entry
# 
# Revision 3.1  88/06/18  09:56:25  papowell
# Version 3.0- Distributed Sat Jun 18 1988
# 
# Revision 2.1  88/05/09  10:15:57  papowell
# *** empty log message ***
# 
#
#  The following entries are available:
# 1. make bin - will make the binaries, install them in temp
# 2. make test1 - creates a printcap, runs ${BIN}/checkpc on it.
#     This is the first level test printcap
# 3. make test2 - creates a printcap, runs ${BIN}/checkpc on it.
#     This is a second, more complex printcap
# The HOST is the name of the local host, should be full (see printer_perms)
# The USER is the name of the local user

HOST=attila.cs.umn.edu
USER=papowell
BIN=../bin/
LEVEL=1
TMP=/huge/tmp/

help:
	@echo "uses the HOST and USER environment variables unless overridden"
	@echo "make bin, make test1, make test1"
	exit 1
pc:
	sed -e s/HOST/${HOST}/ -e 's/^#[0-$(LEVEL)]//' -e "s:TMP:${TMP}:g" \
		printcap.proto  >${TMP}printcap.${HOST}
	${BIN}/checkpc -X -f -l
perms:
	sed -e s/HOST/${HOST}/ -e s/USER/${USER}/ printer_perms.proto \
		 >${TMP}printer_perms.${HOST}
test1:
	make LEVEL=1 TMP=${TMP} HOST=${HOST} pc
test2:
	make LEVEL=2 TMP=${TMP} HOST=${HOST} pc
test3:
	make LEVEL=3 TMP=${TMP} HOST=${HOST} pc
test4:
	make LEVEL=4 TMP=${TMP} HOST=${HOST} pc

bin: perms
	install -c -m 755 filter.sh ${TMP}filter
	install -c -m 755 qh.sh ${TMP}qh
	cc -o ${TMP}lpf -DDEBUG ../filters/main.c
clean:
	-rm -f *.o core lpf
