# 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
SRV_LIB	= libpsrv.a

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

CFILES = \
	ad2l_atr.c \
	at_delete.c \
	change_acl.c \
	check_acl.c \
	check_nfs.c \
	chk_localpth.c \
	dsdir.c \
	dsrfinfo.c \
	dswfinfo.c \
	error_reply.c \
	optparse.c \
	plog.c \
	replyf.c \
	retrieve_fp.c \
	srv_qoprintf.c

OBJECTS	= \
	ad2l_atr.o \
	at_delete.o \
	change_acl.o \
	check_acl.o \
	check_nfs.o \
	chk_localpth.o \
	dsdir.o \
	dsrfinfo.o \
	dswfinfo.o \
	error_reply.o \
	optparse.o \
	plog.o \
	replyf.o \
	retrieve_fp.o \
	srv_qoprintf.o 


CODE	= ${CFILES} Makefile

all:	${SRV_LIB}

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

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

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

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



src:	${CODE}

${CODE}:
	co -q $@

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

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

# Dependencies
ad2l_atr.o : \
  ../../include/pfs.h \
  ../../include/ardp.h \
  ../../include/list_macros.h 
at_delete.o : ../../include/pfs.h \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/psrv.h ../../include/pparse.h 
change_acl.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/pfs.h \
  ../../include/psite.h ../../include/pprot.h \
  ../../include/plog.h \
  ../../include/pmachine.h 
check_acl.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/pfs.h \
  ../../include/pserver.h ../../include/pprot.h \
  ../../include/plog.h \
  ../../include/pmachine.h 
check_nfs.o : \
  ../../include/pfs.h \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pmachine.h 
chk_localpth.o : \
  ../../include/pmachine.h ../../include/pserver.h \
  ../../include/pfs.h ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/plog.h 
dsdir.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/pfs.h ../../include/plog.h \
  ../../include/pprot.h ../../include/perrno.h ../../include/pmachine.h ../../include/pparse.h 
dsrfinfo.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pfs.h ../../include/plog.h \
  ../../include/pprot.h ../../include/perrno.h ../../include/pmachine.h ../../include/pparse.h 
dswfinfo.o : ../../include/pfs.h \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pparse.h \
  ../../include/psrv.h ../../include/perrno.h ../../include/plog.h 
error_reply.o : ../../include/ardp.h \
  ../../include/list_macros.h ../../include/psrv.h ../../include/pparse.h \
  ../../include/pfs.h \
  ../../include/plog.h ../../include/pprot.h 
optparse.o : ../../include/pfs.h \
  ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/pparse.h \
  ../../include/psrv.h ../../include/perrno.h 
plog.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/pfs.h ../../include/pserver.h ../../include/plog.h \
  ../../include/pmachine.h 
replyf.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/pfs.h \
  ../../include/plog.h \
  ../../include/pprot.h 
retrieve_fp.o : \
  ../../include/pfs.h ../../include/ardp.h \
  ../../include/list_macros.h \
  ../../include/perrno.h 
srv_qoprintf.o : \
  ../../include/ardp.h \
  ../../include/list_macros.h ../../include/pfs.h ../../include/pparse.h \
  ../../include/psrv.h 
