# Makefile for GNU CC
# using 16 bit ints

include ../Makevars

#redefine cflags
CFLAGS = -mshort -Wall -I$(BUILDDIR)/lib -O2 -DSYSLOG

all    : nfsd rpc.mountd
install : nfsd rpc.mountd
	$(INSTALL) rpc.mountd $(USRETCDIR)/rpc.mountd
	$(INSTALL) nfsd $(USRETCDIR)/nfsd


COMOBJ0 = auth.o fh.o util.o exportent.o syslog.o

NFSDOBJ0 = nfsd.o nfssvc.o auth_nfs.o ../xfs/nfs_xdr.o

MNTDOBJ0 = mountd.o auth_mnt.o mount_xdr.o

nfsd        : $(NFSDOBJ0) $(COMOBJ0)
		$(LD) $(LDFLAGS) -o nfsd $(NFSDOBJ0) $(COMOBJ0) $(LIBS)
		fixstk 65536 nfsd
		strip nfsd
		chmod 700 nfsd

rpc.mountd  : $(MNTDOBJ0) $(COMOBJ0)
		$(LD) $(LDFLAGS) -o rpc.mountd $(MNTDOBJ0) $(COMOBJ0) $(LIBS)
		fixstk 32768 rpc.mountd
		mv rpc.mountd mountd
		strip mountd
		mv mountd rpc.mountd
		chmod 700 rpc.mountd

nfsd.o         : nfsd.c ../xfs/nfs.h auth.h version.h
auth.o         : auth.c auth.h exportent.h
nfssvc.o       : nfssvc.c fh.h ../xfs/nfs.h
auth_nfs.o     : auth_nfs.c auth.h
fh.o           : fh.c fh.h
util.o         : util.c
exportent.o    : exportent.c exportent.h
../xfs/nfs_xdr.o   : ../xfs/nfs_xdr.c
syslog.o       : syslog.c syslog.h

mount_xdr.o    : mount_xdr.c mount.h 
auth_mnt.o     : auth_mnt.c auth.h
mountd.o       : mountd.c mount.h auth.h version.h util.h 


clean :
	$(RM) -f *.o
