# $Id: Smakefile,v 1.3 1994/05/15 11:47:21 jraja Exp $
#
# Smakefile for sort
#
# Copyright  1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
#                  Helsinki University of Technology, Finland.
#                  All rights reserved.
#
# $Log: Smakefile,v $
# Revision 1.3  1994/05/15  11:47:21  jraja
# Removed usr.lib from libraries.
#
# Revision 1.2  1994/03/09  01:48:04  jraja
# Updated for the first release
#
# Revision 1.1  1993/11/19  03:17:50  jraja
# Initial revision
#
#

MAKE = smake
RM= delete
CC= sc
RPCCOM= rpcgen
LD= slink

#
# Note that we have selected the register argument version of the rpc
# library and the SCOPTIONS file has PARAMETERS option set to REGISTER.
#
LIBS= LIB NETLIB:rpcr.lib NETLIB:net.lib

BIN = rsort sort_svc
GEN = sort_clnt.c sort_svc.c sort_xdr.c sort.h

all: $(BIN)

rsort: rsort.o sort_clnt.o sort_xdr.o
	$(CC) LINK TO $@ OBJ rsort.o sort_clnt.o sort_xdr.o $(LIBS)

rsort.o: rsort.c sort.h

sort_clnt.o: sort_clnt.c
sort_clnt.c:
	$(RPCCOM) -l sort.x >$@

sort_svc: sort_proc.o sort_svc.o sort_xdr.o
	$(CC) LINK TO $@ OBJ sort_proc.o sort_svc.o sort_xdr.o $(LIBS)

sort_proc.o: sort_proc.c sort.h

sort_svc.o: sort_svc.c
sort_svc.c:
	$(RPCCOM) -s udp sort.x >$@

sort_xdr.o: sort_xdr.c
sort_xdr.c:
	$(RPCCOM) -c sort.x >$@

sort.h:
	$(RPCCOM) -h sort.x >$@

clean cleanup:
	$(RM) $(GEN) \#?.(o|lnk|map) $(BIN) \#?!
