CFLAGS=-g -DRUTGERS -DUSEVPRINTF -DETCDIR=\"/etc\"
LIBABSRCS=abelap.c aarpd.x snitp.c aarp.c ../uab/hash.c
LIBABOBJS=abelap.o aarpd_clnt.o aarpd_svc.o aarpd_xdr.o snitp.o aarp.o hash.o

all: abetalk.o aarpd

abetalk.o: ${LIBABOBJS} aarpd_svc.c aarpd.h
	cc -r -o abetalk.o ${LIBABOBJS}

aarpd:
	(cd ../aarpd; make)

install:
	(cd ../aarpd; make install)

aarpd.h aarpd_clnt.c aarpd_svc.c aarpd_xdr.c: aarpd.x
	rpcgen aarpd.x
	rpcgen -m -o aarpd_svc.c aarpd.x

aarpd_clnt.o: aarpd_clnt.c aarpd.h

aarpd_svc.o: aarpd_svc.c aarpd.h

aarpd_xdr.o: aarpd_xdr.c aarpd.h

snitp.o: snitp.c ../uab/proto_intf.h

aarp.o: ../uab/hash.h ../uab/proto_intf.h ../uab/ethertalk.h \
		../uab/aarp_defs.h ../uab/aarp.h ../uab/log.h
	cc -c $(CFLAGS) -DAARPD ../uab/aarp.c

hash.o: ../uab/hash.h
	cc -c $(CFLAGS) ../uab/hash.c

clean:
	rm -f *.o core
