# Name: Makefile
# Description: Makefile for the nfs directory. It uses rpcgen to generate
#     the rpc server stubs.
# Author: Christian Starkjohann <cs@hal.kph.tuwien.ac.at>
# Date: 1996-11-14
# Copyright: GNU-GPL
# Tabsize: 4

VPATH = .
srcdir = .

#CC = gcc
#AR = ar
#RANLIB = ranlib

RPCGEN = rpcgen 

CFLAGS +=  -I. -I..
LDFLAGS += 
WARNFLAGS = -Wall
RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized
TRANSPORTFLAGS =  -s udp -s tcp

XDRFILES	= nfs_prot.x
OFILES		= nfs_prot_xdr.o mount.o nfs_funcs.o syscalls.o

all: nfs.o

COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARNFLAGS)

.c.o:
	$(COMPILE) $<

nfs.o: $(OFILES)
	$(LD) -r -o $@ $(OFILES)

nfs_prot.h: nfs_prot.x
	rm -f $@
	$(RPCGEN) -h -o $@ $?

nfs_prot_xdr.c: nfs_prot.x
	rm -f $@
	$(RPCGEN) -c $? | \
		sed 's;^#include ".*/nfs_prot.h"$$;#include "nfs_prot.h";' >$@

nfs_prot_xdr.o: nfs_prot_xdr.c nfs_prot.h
	$(COMPILE) $(RPC_WARNFLAGS) -c nfs_prot_xdr.c

clean:
	rm -f $(OFILES) nfs.o nfs_prot.h nfs_prot_xdr.c nfs_prot_sstub.c

