# FILE NAME: Makefile 
# Makefile for the arithmetic application
#
# definitions for this make file
#
APPL=arithmetic
IDLCMD=idl -v
LIBS = -ldce -lpthreads -lc_r -lmach -lm		# DEC Alpha OSF/1
CFLAGS= -D_SHARED_LIBRARIES -Dalpha -D_REENTRANT	# DEC Alpha OSF/1
CC=cc 


#
# COMPLETE BUILD of the application
#
all:	local interface client server


#
# LOCAL BUILD of the client application to test locally
#       
local:	interface client.c procedure.c
	   $(CC)   -DLOCAL -o local_client client.c procedure.c
# remove object files so they do not interfere with a real build
	   rm client.o procedure.o


#
# INTERFACE BUILD 
#
interface:	$(APPL).h $(APPL)_cstub.o $(APPL)_sstub.o
$(APPL).h $(APPL)_cstub.o $(APPL)_sstub.o:	$(APPL).idl
	   $(IDLCMD) $(APPL).idl


#
# CLIENT BUILD 
#
client:	$(APPL).h client.o $(APPL)_cstub.o 
	   $(CC) $(CFLAGS) -o client client.o $(APPL)_cstub.o $(LIBS) 


#
# SERVER BUILD 
#
server:	$(APPL).h server.o procedure.o $(APPL)_sstub.o
	   $(CC) $(CFLAGS) -o server server.o procedure.o $(APPL)_sstub.o $(LIBS)
