# 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

AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV -DRXDEBUG -DFSSYNC_BUILD_SERVER -DAFS_DEMAND_ATTACH_FS

RELDIR=dviced
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\config\NTMakefile.version

############################################################################
# Build the dafs-fileserver

EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\dafileserver.exe

VICED = ..\viced
TVICED = ..\tviced
LIBACL = ..\libacl
DIR = ..\dir
FSINT = ..\fsint
RX = ..\rx

RXOBJS = $(OUT)\xdr_int64.obj \
         $(OUT)\xdr_int32.obj

VICEDOBJS = $(OUT)\viced.obj $(OUT)\afsfileprocs.obj $(OUT)\fsstats.obj $(OUT)\host.obj $(OUT)\physio.obj $(OUT)\callback.obj 

TVICEDOBJS = $(OUT)\serialize_state.obj

DAFS_VICEDRES =  $(OUT)\dafileserver.res

LIBACLOBJS = $(OUT)\aclprocs.obj $(OUT)\netprocs.obj

DIROBJS = $(OUT)\buffer.obj $(OUT)\dir.obj $(OUT)\salvage.obj

FSINTOBJS = $(OUT)\afsaux.obj $(OUT)\afscbint.cs.obj $(OUT)\afsint.ss.obj $(OUT)\afsint.xdr.obj

EXEOBJS = $(VICEDOBJS) $(TVICEDOBJS) $(DAFS_VICEDRES) $(LIBACLOBJS) \
	  $(DIROBJS) $(FSINTOBJS) $(RXOBJS)

noversion: install

all: $(EXEFILE)

$(RXOBJS): $(RX)\$$(@B).c
	$(C2OBJ) -I$(RX) $**

$(VICEDOBJS): $(VICED)\$$(@B).c
	$(C2OBJ) -I$(VICED) $**

$(DAFS_VICEDRES): dafileserver.rc AFS_component_version_number.h
	$(RC) /fo $(DAFS_VICEDRES) dafileserver.rc

$(TVICEDOBJS): $(TVICED)\$$(@B).c
	$(C2OBJ) -I$(TVICED) $**

$(LIBACLOBJS): $(LIBACL)\$$(@B).C
	$(C2OBJ) -I$(LIBACL) $**

$(DIROBJS): $(DIR)\$$(@B).C
	$(C2OBJ) -I$(DIR) $**

$(FSINTOBJS): $(FSINT)\$$(@B).C
	$(C2OBJ) -I$(FSINT) $**

EXELIBS = \
	$(DESTDIR)\lib\afsauthent.lib \
	$(DESTDIR)\lib\afsrpc.lib \
	$(DESTDIR)\lib\afs\afscmd.lib \
	$(DESTDIR)\lib\afs\afsaudit.lib \
	$(DESTDIR)\lib/afs/afscom_err.lib \
	$(DESTDIR)\lib\afs\afsreg.lib \
	$(DESTDIR)\lib\afs\afsprocmgmt.lib \
	$(DESTDIR)\lib\afs\afseventlog.lib \
	$(DESTDIR)\lib\afs\mtafsutil.lib \
        $(DESTDIR)\lib\afs\daafsvol.lib \
        $(DESTDIR)\lib\afs\mtafsvldb.lib \
	$(DESTDIR)\lib\afspthread.lib \
	$(DESTDIR)\lib\opr.lib \
	$(DESTDIR)\lib\afsroken.lib

$(EXEFILE): $(EXEOBJS) $(EXELIBS)
	$(EXECONLINK)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP) 
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)

install:  $(EXEFILE)

mkdir:
	
clean::
	-$(DEL) $(EXEFILE)
        -$(DEL) $(DAFS_VICEDRES)

