# Make file for cmds/etc 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/biod \
	/usr/sbin/nfsd \
	/usr/sbin/portmap \
	/usr/sbin/fsirand \
	/usr/lib/netsvc/yp/ypbind \
	/usr/newconfig/etc/netgroup \
	/usr/newconfig/etc/rpc \
	/usr/newconfig/etc/publickey \
	/usr/newconfig/etc/vhe_list

SRCS= nfsd.c biod.c portmap.c fsirand.c ypbind.c

TARGETS= nfsd biod portmap fsirand ypbind state

INCLUDES= -I/source/NFS/${LOGNAME}/include -I/usr/include

CCFLAGS= $(INCLUDES) $(CFLAGS)

#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 nfsd biod portmap fsirand ypbind state

build: $(TARGETS)

nfsd:
	$(CC) $(CCFLAGS) $(LDFLAGS) -o nfsd nfsd.c 

biod:
	$(CC) $(CCFLAGS) $(LDFLAGS) -o biod biod.c 

portmap:
	$(CC) $(CCFLAGS) $(LDFLAGS) -o portmap portmap.c 

fsirand:
	$(CC) $(CCFLAGS) $(LDFLAGS) -o fsirand fsirand.c -lfs

ypbind: logging.o
	$(CC) $(CCFLAGS) $(LDFLAGS) -o ypbind ypbind.c logging.o

logging.o:  /source/NFS/$(LOGNAME)/cmds/usr.etc/logging.c
	$(CC) $(CCFLAGS) -c /source/NFS/$(LOGNAME)/cmds/usr.etc/logging.c
	
state:
	/usr/bin/touch state

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

