#       Makefile for RPC tests on priam
#
#
RRC = ../../../rts/c/
RPC_INC = ../../../rts/c
RPCRTS_H = $(RPC_INC)/rpcrts.h
XDIR = .

#       Choose the RPC library to use:

RPCLIB = ../../../rts/c/os9/rpclib.l

C68FLAGS = -V$(RPC_INC) -r=.


#-----------------------------------------------------------

all : big_ser_c big_cli_c cback_cli_c cback_ser_c
	touch all

time_ser_c : time_ser_c.o time_sub_c.o $(RPCLIB) $(RPCRTS_H)

	cc -I$(RPC_INC) -o time_ser_c   \
	      time_ser_c.o time_sub_c.c $(RPCLIB)
	chmod +x time_ser_c

time_ser_c.o : time_ser_c.c $(RPCRTS_H) 
	cc68 -c -I$(RPC_INC) time_ser_c.c

time_ser_c.c : time.rpc $(RPCC) $(RPCRTS_H)
	$(RPCC) -byvalue -sgenericc=time_ser_c.c time.rpc
	cc68 -c -I$(RPC_INC) time_ser_c.c

time_sub_c.o : time_sub_c.c $(RPCRTS_H)
	cc68 -c -I$(RPC_INC) time_sub_c.c

time_cli_c : time_cli_c.o time_prog_c.o $(RPCLIB) $(RPCRTS_H)
	cc68 -I$(RPC_INC) -o time_cli_c time_cli_c.o time_prog_c.o -L=$(RPCLIB)
	chmod +x time_cli_c
time_cli_c.o : time_cli_c.c $(RPCRTS_H)
	cc68 -c -I$(RPC_INC) time_cli_c.c
time_cli_c.c : time.rpc $(RPCC) $(RPCRTS_H)
	$(RPCC) -byvalue -cgenericc=time_cli_c.c time.rpc
	cc68 -c -I$(RPC_INC) time_cli_c.c
time_prog_c.o : time_prog_c.c $(RPCRTS_H)
	cc68 -c -I$(RPC_INC) time_prog_c.c
#____________________________________________________________________


big_ser_c : big_ser_c.r ../big_sloop_c.c $(RPCLIB) $(RPCRTS_H)
	cc68 -V=$(RPC_INC) -FD=big_ser_c -L=$(RPCLIB) \
	    ../big_sloop_c.c big_ser_c.r ../big_sub_c.c

big_ser_c.r : ../big_ser_c.c $(RPCRTS_H)
	cc68 -r=. -V=$(RPC_INC) ../big_ser_c.c

big_sub_c.r : ../big_sub_c.c $(RPCRTS_H)
	cc68 -R=. -V=$(RPC_INC) ../big_sub_c.c

big_cli_c : big_cli_c.r big_prog_c.r $(RPCLIB)
	cc68 -FD=big_cli_c -L=$(RPCLIB) big_cli_c.r big_prog_c.r

big_cli_c.r : ../big_cli_c.c $(RPCRTS_H)
	cc68 -R=. -V=$(RPC_INC) ../big_cli_c.c

big_prog_c.r : ../big_prog_c.c $(RPCRTS_H)
	cc68 -R=. -V=$(RPC_INC) ../big_prog_c.c

#____________________________________________________________________

cback1_ser_c.r : ../cback1_ser_c.c $(RPCHEADER)
	cc68 =R=. -V=$(RPC_INC) ../cback1_ser_c.c
cback1_cli_c.r : ../cback1_cli_c.c $(RPCHEADER)
	cc68 =R=. -V=$(RPC_INC) ../cback1_ser_c.c
cback2_ser_c.r : ../cback2_ser_c.c $(RPCHEADER)
	cc68 =R=. -V=$(RPC_INC) ../cback1_ser_c.c
cback2_cli_c.r : ../cback2_cli_c.c $(RPCHEADER)
	cc68 =R=. -V=$(RPC_INC) ../cback1_ser_c.c

cback_ser_c : cback1_ser_c.r cback2_cli_c.r ../cback_sub_c.c $(RPCLIB)
	cc68 -FD=cback_ser_c -V=$(RPC_INC) cback1_ser_c.r cback2_cli_c.r ../cback_sub_c.c -L=$(RPCLIB)

cback_cli_c : cback2_ser_c.r cback1_cli_c.r ../cback_prog_c.c $(RPCLIB)
	cc68 -FD=cback_cli_c -V=$(RPC_INC) cback2_ser_c.r cback1_cli_c.r ../cback_prog_c.c -L=$(RPCLIB)
