/*
Copyright (c) 1991-1995 Xerox Corporation.  All Rights Reserved.  

Unlimited use, reproduction, and distribution of this software is
permitted.  Any copy of this software must include both the above
copyright notice of Xerox Corporation and this paragraph.  Any
distribution of this software must comply with all applicable United
States export control laws.  This software is made available AS IS,
and XEROX CORPORATION DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE, AND NOTWITHSTANDING ANY OTHER
PROVISION CONTAINED HEREIN, ANY LIABILITY FOR DAMAGES RESULTING FROM
THE SOFTWARE OR ITS USE IS EXPRESSLY DISCLAIMED, WHETHER ARISING IN
CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, EVEN IF
XEROX CORPORATION IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

$Id: Imakefile,v 1.101 1996/02/24 04:26:55 janssen Exp $
*/
/* Last edited by Mike Spreitzer February 19, 1996 9:36 pm PST */

#define IHaveSubdirs

SUBDIRS = os

CC_LINK =

NormalObjectRule()
ILUCINCLUDES=

BASEOBJS = \
  alarmux.o \
  call.o \
  connect.o \
  crc32.o \
  debug.o \
  error.o \
  gc.o \
  hash.o \
  identity.o \
  ilubufxp.o \
  inmem.o \
  locks.o \
  mainloop.o \
  memory.o \
  method.o \
  object.o \
  port.o \
  protocol.o \
  server.o \
  transprt.o \
  type.o \
  vector.o


O1 =
#ifdef ADD_SUNRPC_PROTOCOL
O1 = sunrpc.o
#endif /* ADD_SUNRPC_PROTOCOL */

O2 =
#ifdef ADD_COURIER_PROTOCOL
O2=courier.o
#endif /* ADD_COURIER_PROTOCOL */

O3 =
#ifdef ADD_IIOP_PROTOCOL
O3 = iiop.o
#endif /* ADD_IIOP_PROTOCOL */

O4 =
#ifdef ADD_W3NG_PROTOCOL
O4 = w3ng.o
#endif /* ADD_W3NG_PROTOCOL */

O5 =
#ifdef ADD_TCPSOCKET_TRANSPORT
O5 = newtcp.o
#endif /* ADD_TCPSOCKET_TRANSPORT */

O6 =
#ifdef ADD_UDPSOCKET_TRANSPORT
O6 = udp.o
#endif /* ADD_UDPSOCKET_TRANSPORT */

O7 =
#ifdef ADD_W3MUX_TRANSPORT
O7 = w3mux.o
#endif /* ADD_W3MUX_TRANSPORT */

O8 =
#ifdef _IS_BSD
O8 = bsdutils.o bsdmnlp.o
#endif /* _IS_BSD */

O9 =
I1 =
#if (defined(ILU_BINDING_DIRECTORY))
O9 = sbfile.o
#else
#if (defined(ILU_BINDING_HOST))
O9 = sbilu.o
#else
#if (defined(ILU_BINDING_MCASTADDR))
O9 = sbmcast.o
I1 = $(MULTICAST_INCLUDES)
#else
all::
	echo "ILU cannot be built without some form of simple binding."
	exit 3
#endif
#endif
#endif

O10 =
#if       (defined(ADD_SUNRPCRM_TRANSPORT) || defined(ADD_SUNRPC_PROTOCOL))
O10 = sunrpcrm.o
#endif /* (defined(ADD_SUNRPCRM_TRANSPORT) || defined(ADD_SUNRPC_PROTOCOL)) */

O11 =
I2 =
#ifdef    ADD_SECURE_TRANSPORT
O11 = security.o
#ifdef USING_ILUGSS
I2 = -I../../GSS/kernel
#else
I2 = $(GSS_INCLUDES)
#endif
#endif /* ADD_SECURE_TRANSPORT */


OTHEROBJS = ${O1} ${O2} ${O3} ${O4} ${O5} ${O6} ${O7} ${O8} ${O9} ${O10} ${O11}

LOCALINCLUDES = ${I1} ${I2}

OBJS = ${BASEOBJS} ${OTHEROBJS}

PUBIFC = iluxport.h iluconf.h iluerror.h ilubasic.h iluerrs.h
PVTIFC = iluntrnl.h $(PUBIFC) iludebug.h iluhash.h
MF = Makefile

alarmux.o: alarmux.c $(PVTIFC)
call.o : call.c $(PVTIFC) protocol.h connect.h transprt.h port.h call.h object.h method.h server.h type.h
connect.o : connect.c $(PVTIFC) object.h server.h connect.h transprt.h protocol.h
debug.o : debug.c $(PVTIFC) oscalls.h
error.o : error.c $(PVTIFC)
gc.o : gc.c $(PVTIFC) object.h call.h server.h type.h vector.h
hash.o : hash.c iluhash.h
identity.o : identity.c $(PVTIFC)
ilubufxp.o : ilubufxp.c $(PVTIFC) transprt.h
inmem.o : inmem.c $(PVTIFC) mooring.h transprt.h
locks.o : locks.c $(PVTIFC)
mainloop.o : mainloop.c $(PVTIFC) oscalls.h
memory.o: memory.c $(PVTIFC) oscalls.h
method.o : method.c $(PVTIFC) method.h type.h
object.o : object.c $(PVTIFC) object.h server.h type.h protocol.h port.h vector.h version.h
port.o : port.c $(PVTIFC) port.h mooring.h protocol.h transprt.h object.h server.h
protocol.o : protocol.c $(PVTIFC) transprt.h protocol.h call.h type.h
server.o : server.c $(PVTIFC) server.h object.h type.h connect.h port.h
transprt.o : transprt.c $(PVTIFC) transprt.h
type.o : type.c $(PVTIFC) object.h server.h type.h vector.h
vector.o : vector.c $(PVTIFC) vector.h

courier.o : courier.c $(PVTIFC) call.h protocol.h connect.h transprt.h port.h object.h type.h method.h mooring.h
dcerpc.o : dcerpc.c $(PVTIFC) packet.h dcerpc.h call.h protocol.h connect.h pipe.h transprt.h port.h object.h type.h method.h mooring.h
iiop.o : iiop.c $(PVTIFC) iiop.h call.h protocol.h connect.h transprt.h port.h object.h type.h method.h mooring.h server.h
w3ng.o : w3ng.c $(PVTIFC) w3ng.h call.h protocol.h connect.h transprt.h port.h object.h type.h method.h mooring.h server.h
sunrpc.o : sunrpc.c $(PVTIFC) sunrpc.h call.h protocol.h connect.h transprt.h port.h object.h type.h method.h mooring.h
text.o : text.c iluxport.h iluntrnl.h protocol.h object.h call.h connect.h text.h method.h mooring.h port.h transprt.h bffrlist.h Imakefile

newtcp.o : newtcp.c $(PVTIFC) transprt.h mooring.h ilusock.h oscalls.h
security.o : security.c $(PVTIFC) transprt.h mooring.h oscalls.h ../../GSS/kernel/gssapi.h
sunrpcrm.o : sunrpcrm.c $(PVTIFC) transprt.h mooring.h oscalls.h
w3mux.o : w3mux.c $(PVTIFC) transprt.h mooring.h oscalls.h
udp.o : udp.c $(PVTIFC) transprt.h mooring.h ilusock.h oscalls.h

bsdmnlp.o : bsdmnlp.c $(PVTIFC) oscalls.h
bsdutils.o : bsdutils.c $(PVTIFC) oscalls.h ilusock.h
sbfile.o : sbfile.c $(PVTIFC) object.h oscalls.h
sbilu.o : sbilu.c $(PVTIFC) object.h
sbmcast.o : sbmcast.c $(PVTIFC) object.h ilusock.h

libilu.a : $(MF)

LibraryTarget(libilu.a, $(OBJS))
InstallLibrary(libilu.a, $(DESTDIR)/lib)
InstallRO(iluconf.h ilubasic.h iluxport.h iluntrnl.h iludebug.h iluerror.h iluerrs.h iluhash.h, $(DESTDIR)/include)

CProgramTarget(iluhashm,iluhashm.o,,)
CProgramTarget(decoderr,decoderr.o,,)
InstallPrograms(decoderr iluhashm, $(DESTDIR)/bin)

decoderr.o: errhashs.c $(MF)

SL = /

errhashs.c: iluhashm $(MF)
	./iluhashm 32771 *.[ch] ../c$(SL)*.[ch] ../cpp$(SL)*.hh ../cpp$(SL)*.cpp ../lisp$(SL)*.[ch] ../python$(SL)*.[ch] > errhashs.c

#ifdef ILU_BINDING_DIRECTORY
MkdirTarget(${SIMPLE_BIND_DIRECTORY})
#endif

TestProgramTarget(testit, testskeleton.o, libilu.a,)

dist::
	rm -f version.h
	( echo "#define ILU_VERSION $(RELNUM)" ; echo "#define ILU_VERSION_STRING \"$(RELNUM)\"" ) >version.h
	( echo "#define ILU_MAJOR_VERSION $(RELNUM)" | sed -e 's/\([0-9]*\)\..*/\1/' ) >>version.h 
	( echo "#define ILU_MINOR_VERSION $(RELNUM)" | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\2/' ) >>version.h 
	chmod 444 version.h
