# Where to find things and to put things
P_BINARIES= UNDEFINED
P_INC	= -I../../include
INCS	= ${P_INC}

# libraries should be relative to this dir, not SRC
RDP_LIB	= libardp.a

CC	= gcc
CFLAGS  = -g
F_CC	= $(CFLAGS) -c
F_CPP	= ${INCS} ${MACHDEF}

CFILES = ardp_abort.c \
	ardp_accept.c \
	ardp_add2req.c \
	ardp_get_nxt.c \
	ardp_headers.c \
	ardp_pr_actv.c \
	ardp_ptalloc.c \
	ardp_reply.c \
	ardp_respond.c \
	ardp_retriev.c \
	ardp_rqalloc.c \
	ardp_send.c \
	ardp_snd_pkt.c \
	ardp_srv_ini.c \
	ardp_xmit.c

OBJECTS = ardp_abort.o \
	ardp_accept.o \
	ardp_add2req.o \
	ardp_get_nxt.o \
	ardp_headers.o \
	ardp_pr_actv.o \
	ardp_ptalloc.o \
	ardp_reply.o \
	ardp_respond.o \
	ardp_retriev.o \
	ardp_rqalloc.o \
	ardp_send.o \
	ardp_snd_pkt.o \
	ardp_srv_ini.o \
	ardp_xmit.o

CODE	= ${CFILES} Makefile

all:	${RDP_LIB}

install:
	cp ${RDP_LIB} ${P_BINARIES}/${RDP_LIB}
	ranlib ${P_BINARIES}/${RDP_LIB}

clean:
	rm -f a.out core *~ tags TAGS
	rm -f ${OBJECTS} ${RDP_LIB}

hide:
	-mkdir .hide
	-mv -f a.out core *~ tags TAGS ${OBJECTS} ${RDP_LIB} .hide

unhide:
	-mv .hide/* .hide/.??* .
	-rmdir .hide

src:	${CODE}

${CODE}:
	co -q $@

${OBJECTS}:
	${CC} ${F_CC} ${F_CPP} $*.c

${RDP_LIB}: ${OBJECTS}
	rm -f ${RDP_LIB}
	ar rv ${RDP_LIB} ${OBJECTS}
	ranlib ${RDP_LIB}

# Dependencies
ardp_abort.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pmachine.h 
ardp_accept.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pserver.h ../../include/plog.h \
  ../../include/pprot.h ../../include/perrno.h ../../include/pmachine.h 
ardp_add2req.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_get_nxt.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_headers.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_pr_actv.o : \
  ../../include/perrno.h ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_ptalloc.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_reply.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_respond.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/plog.h 
ardp_retriev.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/perrno.h 
ardp_rqalloc.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
ardp_send.o : \
  ../../include/pmachine.h ../../include/ardp.h \
  ../../include/list_macros.h ../../include/perrno.h ../../include/pcompat.h ../../include/pfs.h 
ardp_snd_pkt.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/plog.h 
ardp_srv_ini.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/plog.h 
ardp_xmit.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h 
