.SUFFIXES: .c .a86 .b
.SUFFIXES: .c .a86 .w

LIB = ../../lib
INCLUDE = ../../include
OBJS = enet.b et_close.b et_stat.b et_arp.b et_init.b et_demux.t.b \
	et_send.b et_int.b ethint.b

WOBJS = enet.w et_close.b et_stat.w et_arp.b et_init.b et_demux.t.w \
	et_send.w et_int.w ethint.b

all: libether libwether

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

libwether: ${WOBJS}
	ar r ${LIB}/libwether.a ${WOBJS}
	ranlib ${LIB}/libwether.a

${OBJS} ${WOBJS}: ${INCLUDE}/ether.h ${INCLUDE}/netbuf.h ether.h

et_int.w: ${INCLUDE}/match.h

lintlib:
	lint86 -Cether enet.c et_arp.c et_close.c et_demux.t.c et_init.c \
	et_int.c et_send.c et_stat.c lint.c
	mv llib-lether.ln ${LIB}
	lint86 -Cwether -DWATCH enet.c et_arp.c et_close.c et_demux.t.c \
	et_init.c et_int.c et_send.c et_stat.c lint.c
	mv llib-lwether.ln ${LIB}

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

.c.w:
	mv $*.b $*.save
	cc86 -c -DDEBUG -DWATCH $*.c
	mv $*.b $*.w
	mv $*.save $*.b

.a86.b:
	a86 $*
