# Make file for cmds/usr.etc/rpc.lockd directory
#
# Things you might want to change.  Pass them in on the command line:
# ROOT - should point to the root where the commands will be installed
#        (e.g. /deliver/NFS/indnetwk)

ROOT=

PRODUCTS= /usr/sbin/rpc.lockd

OBJS= prot_main.o prot_lock.o prot_pklm.o prot_pnlm.o prot_msg.o\
	prot_proc.o prot_alloc.o prot_priv.o prot_free.o prot_share.o\
	pmap.o tcp.o udp.o xdr_nlm.o xdr_klm.o\
	xdr_sm.o sem.o sm_monitor.o svc_udp.o hash.o prot_libr.o nfs_fcntl.o \
	logging.o

INCLUDES= -I/source/NFS/$(LOGNAME)/include -I/usr/include
CCFLAGS= $(INCLUDES) $(CFLAGS)

#Commands used by this Makefile
AS=/usr/ccs/bin/as

#Install database name
INSTALLDB=/source/NFS/$(LOGNAME)/config/installdb

#Script called to parse the install deliverable
INSTALLSCPT=/source/NFS/$(LOGNAME)/config/install_script

# Defaults file containing the shell, compiler options, etc
BUILDRULES=/source/NFS/$(LOGNAME)/config/defaults

include ${BUILDRULES}

default: all

all: clean build install

clean:
	$(RM) -f *.o rpc.lockd

build: rpc.lockd

.c.o:
	$(CC) $(CCFLAGS) -c $*.c

rpc.lockd: $(OBJS)
	$(ECHO) "Building rpc.lockd..."
	$(CC) $(CCFLAGS) $(LDFLAGS) -o rpc.lockd $(OBJS) $(RPCSVC_LIB)

logging.o: 
	$(CC) $(CCFLAGS) -c ../logging.c $(RPCSVC_LIB)


# NOTE: The following defines and target are used to produce the system
# call stub for calling nfs_fcntl on the 800.  This may just go away on the
# 800 if nfs_fcntl.o goes into libc.  At any rate, the SYS.h in this
# directory should really be the real one they are currently using.  However,
# we don't have the ability to pull that at the moment, so just do this
# for now.  This code was copied from the 800 stub makefile.  Darren Smith

CPPFLAGS=-P -DAS -DLOCORE $(NMCFLAGS)
PREFIX=/usr/lib/pcc_prefix.s
SED=/usr/bin/sed
SEDFLAGS= -e '/^[       ]*$$/d' -e 's/^\./      \./' -e 's/; _/;/' -e 'y/; /\n /' -e 's/ /     /'

nfs_fcntl.o:
	cpp $(CPPFLAGS) nfs_fcntl.c | $(SED) $(SEDFLAGS) | cat $(PREFIX) - | $(AS) $(ASMFLAGS) -o nfs_fcntl.o

install:
	for file in $(PRODUCTS) ; do \
		$(INSTALLSCPT) $$file $(INSTALLDB) ;  \
	done

