# FILE NAME: Makefile
# Makefile for the inventory client that uses an ACF and explicit binding
#
# definitions for this make file
#
APPL=inventory
IDLCMD=idl -v
LIBDCE=-ldce -lcma       # dce and thread libraries 
CHECK=../../arithmetic   # directory containing check_status.h
CFLAGS= -D_USER_THREADS_
CC= cc

#
# COMPLETE BUILD of this application.
#
all:	interface client server 


#
# LOCAL BUILD 
# No local build is developed for the explicit client because the remote
# procedure implementations for the server have been developed without
# explicit binding.  In order to test this client locally, the remote 
# procedure implementations need to have a binding handle as the first
# parameter.
#


#
# INTERFACE BUILD that uses an ACF for explicit binding.
# Notice this builds only the client stub and the header files.
#
interface:	$(APPL).acf $(APPL).h $(APPL)_cstub.o
$(APPL).h $(APPL)_cstub.o:	../$(APPL).idl $(APPL).acf
	   $(IDLCMD) -I../ -server none ../$(APPL).idl


#
# CLIENT BUILD
#
client:	explicit_client
explicit_client:	interface explicit_client.o do_import_binding.o do_interpret_binding.o 
	   $(CC) $(CFLAGS) -I../ -o explicit_client.exe explicit_client.o \
		   do_import_binding.o do_interpret_binding.o $(APPL)_cstub.o $(LIBDCE)


#
# SERVER BUILD 
#
server:
	   @echo make server in directory ../


#
# files needed from other directories  
#
i_procedures.o:	../i_procedures.c
	   $(CC) $(CFLAGS) -I../ -c ../i_procedures.c

implement_inventory.o:	../implement_inventory.c
	   $(CC) $(CFLAGS) -I../ -c ../implement_inventory.c


do_import_binding.o:	../implicit/do_import_binding.c
	   $(CC) $(CFLAGS) -I$(CHECK) -c ../implicit/do_import_binding.c

do_interpret_binding.o:	../implicit/do_interpret_binding.c
	   $(CC) $(CFLAGS) -I$(CHECK) -c ../implicit/do_interpret_binding.c
