# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

RELDIR=rx
!include ..\config\NTMakefile.$(SYS_NAME)

# RX has different strings for it's version number.
VERSFILE=RX_component_version_number
CML_PREFIX=rx_

!include ..\config\NTMakefile.version

{.}.c{$(OUT)}.obj:
    $(C2OBJ) $<

# Additional debugging flag for RX.
AFSDEV_AUXCDEFINES = -DRXDEBUG

LIBFILE = $(DESTDIR)\lib\afsrx.lib

# Object files by category.
XDROBJS = $(OUT)\xdr.obj $(OUT)\xdr_array.obj $(OUT)\xdr_arrayn.obj $(OUT)\xdr_float.obj $(OUT)\xdr_mem.obj \
	$(OUT)\xdr_rec.obj  $(OUT)\xdr_refernce.obj $(OUT)\xdr_rx.obj $(OUT)\xdr_update.obj \
	$(OUT)\xdr_afsuuid.obj $(OUT)\xdr_int64.obj $(OUT)\xdr_int32.obj

RXOBJS = $(OUT)\rx_event.obj $(OUT)\rx_clock_nt.obj $(OUT)\rx_user.obj $(OUT)\rx_lwp.obj $(OUT)\rx.obj \
	$(OUT)\rx_null.obj $(OUT)\rx_globals.obj $(OUT)\rx_getaddr.obj $(OUT)\rx_misc.obj $(OUT)\rx_packet.obj \
	$(OUT)\rx_rdwr.obj $(OUT)\rx_trace.obj $(OUT)\rx_xmit_nt.obj $(OUT)\rx_conncache.obj

MULTIOBJS = $(OUT)\rx_multi.obj

LIBOBJS = $(RXOBJS) $(MULTIOBJS) $(XDROBJS)

INCFILEDIR = $(DESTDIR)\include\rx

INCFILES  = \
	$(INCFILEDIR)\rx.h \
	$(INCFILEDIR)\rx_packet.h \
	$(INCFILEDIR)\rx_user.h \
	$(INCFILEDIR)\rx_event.h \
	$(INCFILEDIR)\rx_queue.h \
	$(INCFILEDIR)\rx_globals.h \
	$(INCFILEDIR)\rx_clock.h \
	$(INCFILEDIR)\rx_misc.h \
	$(INCFILEDIR)\rx_multi.h \
	$(INCFILEDIR)\rx_null.h \
	$(INCFILEDIR)\rx_lwp.h \
	$(INCFILEDIR)\rx_pthread.h \
	$(INCFILEDIR)\rx_xmit_nt.h \
	$(INCFILEDIR)\xdr_prototypes.h \
	$(INCFILEDIR)\rx_prototypes.h \
	$(INCFILEDIR)\xdr.h

LOCAL_HEADERS = \
	rx_internal.h

$(LIBOBJS): $(INCFILES) $(LOCAL_HEADERS)

$(MULTIOBJS):  rx_multi.h 

$(XDROBJS): xdr.h

$(LIBFILE): $(LIBOBJS)
	$(LIBARCH)

# Not yet
#rxdumptrace.exe: rx_trace.c

# build rxdebug.
RXDEBUG = $(DESTDIR)\etc\rxdebug.exe
RXDOBJS = $(OUT)\rxdebug.obj \
	  $(OUT)\rxdebug.res

LIBDIR  = $(DESTDIR)\lib
RXDLIBS = $(LIBDIR)\afs\afscmd.lib \
	  $(LIBDIR)\afsrx.lib \
	  $(LIBDIR)\afslwp.lib \
	  $(LIBDIR)\afs\afsutil.lib \
          $(LIBDIR)\afs\afsreg.lib

$(OUT)\rxdebug.res: rxdebug.rc $(VERSFILE).h
	$(RC) /Fo$*.RES $(*F).rc 

$(OUT)\rxdebug.obj: rxdebug.c

$(RXDEBUG): $(RXDOBJS) $(RXDLIBS)
	$(EXECONLINK) iphlpapi.lib
	$(EXEPREP)

install: $(LIBFILE) $(INCFILES) $(RXDEBUG)

install9x: $(LIBFILE) $(INCFILES)

clean::
	$(DEL) $(LIBFILE) $(INCFILES)

mkdir:
	
