#       RaPaCe:  Compile runtime modules for Ultrix
#       -------------------------------------------
#
#	The C sources and most .h headers are all taken from the directory above.
#
C = ..
HEADERS = $(C)/rpcrts.h $(C)/rpc_code.h $(C)/syspec.h unix_specific.h
OBJECTS = rpcrts.o ts.o ts_tcp.o cm_env.o rpc_msg.o errmsg.o
WAY =     ../../../../way
WAYOBJECTS = rpcrts.o ts.o ts_tcp.o cm_way.o $(WAY)/rpc/cliway.o \
		rpc_msg.o way_msg.o errmsg.o
I = -I..
librpc.a : $(WAYOBJECTS)
	ar r librpc.a $(WAYOBJECTS)
	ranlib librpc.a

rpclib.o : $(OBJECTS)
	ld -r -o rpclib.o $(OBJECTS)

rpcrts.o : $(C)/rpcrts.c $(HEADERS)
	cc -c $(I) $(C)/rpcrts.c

ts.o : $(C)/ts.c $(C)/rpc_ts.h $(HEADERS)
	cc -c $(I) $(C)/ts.c

ts_tcp.o : $(C)/ts_tcp.c $(C)/rpc_ts.h $(HEADERS)
	cc -c $(I) $(C)/ts_tcp.c

cm_env.o : $(C)/cm_env.c $(HEADERS)
	cc -c $(I) $(C)/cm_env.c

cm_way.o : $(C)/cm_way.c $(HEADERS)
	cc -c $(I) -I$(WAY) $(C)/cm_way.c
	
rpc_msg.o : $(C)/rpc_msg.c
	cc -c $(I) $(C)/rpc_msg.c
	
way_msg.o : $(C)/way_msg.c
	cc -c $(I) $(C)/way_msg.c

errmsg.o : $(C)/errmsg.c $(C)/errmsg.h
	cc -c $(I) $(C)/errmsg.c

