#
#  makefile for osv_finder (Host OS Version Finder) Version 1.0
#

# compiler and compile flag
CFLAGS  = 
INC_DIRS= -I..
CC      = gcc $(INC_DIRS)

# libraries
MYLIB   = ./libmyerror.a 
LIBS    = $(MYLIB) -lnsl

# executables
PROGS	= osv_finder_svr_2860 osv_finder_clnt_2860
all		: $(PROGS)  

# rule for generating RPC source files
osvfinder.h osvfinder_clnt.c osvfinder_svc.c osvfinder_xdr.c:	osvfinder.x
	rpcgen -C osvfinder.x

# rule for the object file
osvfinder_clnt.o: osvfinder_clnt.c osvfinder.h
osvfinder_svc.o:  osvfinder_svc.c  osvfinder.h

# rule for the executable file
osv_finder_clnt_2860:	osvfinder.h client.o osvfinder_clnt.o osvfinder_xdr.o
	$(CC) $(CFLAGS) -o $@ client.o osvfinder_clnt.o osvfinder_xdr.o $(LIBS)

osv_finder_svr_2860 :	osvfinder.h server.o osvfinder_svc.o osvfinder_xdr.o
	$(CC) $(CFLAGS) -o $@ server.o osvfinder_svc.o  osvfinder_xdr.o $(LIBS)

clean:          
			rm -f $(PROGS) *.o *_clnt.c *_svc.c *_xdr.c osvfinder.h
