.SUFFIXES: .c .a86 .b

LIB = ../../lib
INCLUDE = ../../include
OBJS = tftp_use.b tftp_srv.b tftp_util.b copy512.b
SRCS = tftp_use.c tftp_srv.c tftp_util.c
ASMS = copy512.a86
INCS = tftp.h

LPR = impressify

libtftp: ${OBJS}
	ar r ${LIB}/libtftp.a ${OBJS}
	ranlib ${LIB}/libtftp.a

${OBJS}: ${INCLUDE}/udp.h ${INCLUDE}/timer.h ${INCLUDE}/netbuf.h \
	${INCLUDE}/net.h ${INCLUDE}/task.h ${INCLUDE}/netq.h ${INCLUDE}/q.h \
	${INCLUDE}/custom.h ${INCLUDE}/stdio.h ${INCLUDE}/types.h \
	${INCLUDE}/icmp.h ${INCLUDE}/ip.h ${INCLUDE}/tftp.h tftp.h

lintlib:
	lint86 -Ctftp tftp_use.c tftp_srv.c tftp_util.c
	mv llib-ltftp.ln ${LIB}

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

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

.a86.b:
	a86 $*
