# %W% %G% %U%
#
# 1989 makefile

SHELL=/bin/sh
CFLAGS=-O
CC=cc

WINNERS=ovdluhe jar.1 jar.2 jay merlyn paul robison rowmer vanb tromp 
ALTERNATE=jar.1.orig jay.orig tromp.s5

all: ${WINNERS}

ovdluhe: ovdluhe.c
	${CC} ${CFLAGS} $? -o $@

# NOTE: jar.1.c outputs its string in one section
#       this program may not print well on some terminals
jar.1: jar.1.c jar.1.sh
	rm -f jar.1
	cp jar.1.sh jar.1
	chmod +x jar.1
# NOTE: The jar.1.orig file is the original entry
jar.1.orig: jar.1.orig.c jar.1.orig.sh
	rm -f jar.1.orig
	cp jar.1.sh jar.1.orig
	chmod +x jar.1.orig

jar.2: jar.2.c
	${CC} ${CFLAGS} $? -o $@

# NOTE: jay.c uses the /bin/sh shell
jay: jay.c jay.sh
	rm -f jay
	cp jay.sh jay
	chmod +x jay
# NOTE: The jay.orig.c file is the original entry
jay.orig: jay.orig.c jay.orig.sh
	rm -f jay.orig
	cp jay.orig.sh jay.orig
	chmod +x jay.orig

merlyn: merlyn.c
	${CC} ${CFLAGS} -Dtrgpune=putchar $? -o $@

paul: paul.c
	${CC} ${CFLAGS} $? -o $@

robison: robison.c
	${CC} ${CFLAGS} $? -o $@

rowmer: rowmer.c
	${CC} ${CFLAGS} $? -o $@

# NOTE: this version requires BSD style signals and setitimer
#	this may not work well on low baud rate terminals
#	the file tromp.bsd.c is the original version
tromp: tromp.bsd.c
	${CC} ${CFLAGS} $? -o $@
	touch -f HI
	-chmod 0666 HI
# NOTE: sites without BSD style signals and setitimer (e.g. System V.3)
#	should use this version
tromp.s5: tromp.s5.c
	${CC} ${CFLAGS} $? -o $@
	touch -f HI
	-chmod 0666 HI

vanb: vanb.c
	${CC} ${CFLAGS} $? -o $@

clean:
	rm -f ovdluhe.o jar.2.o jay.o merlyn.o paul.o robison.o
	rm -f rowmer.o tromp.o vanb.o 
	rm -f x x1 incest.c incest.o jay.orig.o tromp.bsd.o tromp.s5.o core
clobber: clean
	rm -f ${WINNERS} 
	rm -f jar.1.o HI 
	rm -f ${ALTERNATE}
nuke: clobber
	@true
install: all
	cat ${WINNERS} > /dev/null
