# Makefile for GNU CC
# using 16 bit ints

include ../Makevars

# new linker setup
XLDFLAGS = -mshort -nostdlib
XLIBS = -L$(BUILDDIR)/lib -lrpc16 -lksocket16 -lgnu16



XFSOBJ0 = init.o main.o
XFSOBJ1 = kludge.o netfs.o netdir.o netdev.o index.o nfsutil.o cache.o
XFSOBJ2 = sock_ipc.o nfs_xdr.o 

all    : nfs.xfs

# here use the cp command, as install would report invalid function 
# number, as MINTDIR is on a TOSFS
install: nfs.xfs
	 $(CP) nfs.xfs $(MINTDIR)/nfs.xfs

init.o      : init.s
main.o      : main.c netfs.h kernel.h version.h proto.h
kludge.o    : kludge.s
netfs.o     : netfs.c netfs.h proto.h config.h kernel.h nfs.h
netdir.o    : netdir.c netfs.h proto.h config.h kernel.h nfs.h
netdev.o    : netdev.c netfs.h proto.h config.h kernel.h nfs.h
index.o     : index.c netfs.h proto.h config.h kernel.h
nfsutil.o   : nfsutil.c kernel.h
cache.o     : cache.c netfs.h proto.h 
sock_ipc.o  : sock_ipc.c proto.h config.h nfs.h message.h

nfs_xdr.o   : nfs_xdr.c nfs.h


nfs.xfs     : $(XFSOBJ0) $(XFSOBJ1) $(XFSOBJ2)
		$(LD) $(XLDFLAGS) -o nfs.xfs $(XFSOBJ0) $(XFSOBJ1) $(XFSOBJ2) $(XLIBS)


clean :
	$(RM) -f *.o
