.SUFFIXES: .c .a86 .b

OBJ = ../../obj
LIB = ../../lib
INCLUDE = ../../include
OBJS = tn.b telnet.b telnet2.b tnscreen.b time.b
SRCS = telnet.c telnet2.c time.c tn.c tnscreen.c
INCS = telnet.h
ASMS =
COMS = ptn.com itn.com 3tn.com stn.com ppgatn.com ipgatn.com 3pgatn.com \
	spgatn.com

VERSION = 80

LPR = impress

itn.com: ${OBJS}
	cc86 -o itn ${OBJS} -ltftp -ltcp -ldomain -ludp -linterlan -lnet -lip \
	-ltask -lh19
	setver86 itn.com ${VERSION}

ipgatn.com: ${OBJS}
	cc86 -o ipgatn ${OBJS} -ltftp -ltcp -ldomain -ludp -linterlan \
	-lnet -lip -ltask -lph19
	setver86 ipgatn.com ${VERSION}

3tn.com: ${OBJS}
	cc86 -o 3tn ${OBJS} -ltftp -ltcp -ldomain -ludp -l3com -lnet -lip \
	-ltask -lh19
	setver86 3tn.com ${VERSION}

3pgatn.com: ${OBJS} ${LIB}/libdomain.a
	cc86 -o 3pgatn ${OBJS} -ltftp -ltcp -ldomain -ludp -l3com -lnet -lip \
	-ltask -lph19
	setver86 3pgatn.com ${VERSION}

ptn.com: ${OBJS}
	cc86 -o ptn ${OBJS} -ltftp -ltcp -ldomain -ludp -lpronet -lnet -lip \
	-ltask -lh19
	setver86 ptn.com ${VERSION}

ppgatn.com: ${OBJS}
	cc86 -o ppgatn ${OBJS} -ltftp -ltcp -ldomain -ludp -lpronet \
	-lnet -lip -ltask -lh19
	setver86 ppgatn.com ${VERSION}

stn.com: ${OBJS}
	cc86 -o stn ${OBJS} -ltftp -ltcp -ldomain -ludp -lserial -lnet -lip \
	-ltask -lh19
	setver86 stn.com ${VERSION}

spgatn.com: ${OBJS}
	cc86 -o spgatn ${OBJS} -ltftp -ltcp -ldomain -ludp -lserial \
	-lnet -lip -ltask -lh19
	setver86 spgatn.com ${VERSION}

${OBJS}: telnet.h

tn.b telnet.b telnet2.b: ${INCLUDE}/custom.h

tn.b telnet.b telnet2.b:  ${INCLUDE}/ip.h

telnet.b: ${INCLUDE}/tftp.h ${INCLUDE}/em.h

telnet2.b: ${INCLUDE}/em.h

time.b: ${INCLUDE}/net.h ${INCLUDE}/timer.h ${INCLUDE}/stdio.h  \
	${INCLUDE}/attrib.h

tnscreen.b: ${INCLUDE}/ip.h ${INCLUDE}/attrib.h

lint:
	lint86 tn.c telnet.c telnet2.c 	tnscreen.c time.c -ltftp -ltcp \
	-ldomain -ludp -l3com -lnet -lip -ltask -lh19 -lc
	lint86 tn.c telnet.c telnet2.c 	tnscreen.c time.c -ltftp -ltcp \
	-ldomain -ludp -lserial -lnet -lip -ltask -lh19 -lc
	lint86 tn.c telnet.c telnet2.c 	tnscreen.c time.c -ltftp -ltcp \
	-ldomain -ludp -lv2 -lnet -lip -ltask -lh19 -lc

all: ${COMS}

install: ${COMS}
	mv ${COMS} ${OBJ}

print: ${SRCS} ${INCS} ${ASMS}
	${LPR} ${SRCS} ${INCS} ${ASMS}

.c.b:
	cc86 -DDEBUG -c $*.c

.a86.b:
	a86 $*
