# 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

# make compiler warnings fatal

AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX

# since we're using rpcndr.h, we can't include <afs/stds.h>'s "hyper" type.

AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DIGNORE_STDS_H

# include the primary makefile

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

############################################################################
#
# BUILD TARGETS
#

INCFILEDIR = $(DESTDIR)\include\WINNT

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

LIBFILE = $(DESTDIR)\lib\afs\TaAfsAdmSvrClient.lib

INCFILES = \
	$(INCFILEDIR)\TaAfsAdmSvr.h \
	$(INCFILEDIR)\TaAfsAdmSvrClient.h \
	$(INCFILEDIR)\TaAfsAdmSvrCommon.h \
	$(INCFILEDIR)\iTaAfsAdmSvr.h \
	$(INCFILEDIR)\iTaAfsAdmSvrTypes.h

IDLFILES = \
	iTaAfsAdmSvr.h \
	iTaAfsAdmSvrTypes.h

LIBOBJS = \
	$(OUT)\TaAfsAdmSvrClient.obj \
	$(OUT)\TaAfsAdmSvrClientBind.obj \
	$(OUT)\TaAfsAdmSvrClientCache.obj \
	$(OUT)\TaAfsAdmSvrClientCell.obj \
	$(OUT)\TaAfsAdmSvrClientGroup.obj \
	$(OUT)\TaAfsAdmSvrClientInternal.obj \
	$(OUT)\TaAfsAdmSvrClientNotify.obj \
	$(OUT)\TaAfsAdmSvrClientPing.obj \
	$(OUT)\TaAfsAdmSvrClientUser.obj \
	$(OUT)\TaAfsAdmSvrCommon.obj \
	$(OUT)\iTaAfsAdmSvr_c.obj

EXERES = $(OUT)\AfsAdmSvr.res


$(EXERES):$$(@B).rc
	$(RC) $**

EXEOBJS = \
	$(OUT)\TaAfsAdmSvr.obj \
	$(OUT)\TaAfsAdmSvrCallback.obj \
	$(OUT)\TaAfsAdmSvrCell.obj \
	$(OUT)\TaAfsAdmSvrCommon.obj \
	$(OUT)\TaAfsAdmSvrDebug.obj \
	$(OUT)\TaAfsAdmSvrGeneral.obj \
	$(OUT)\TaAfsAdmSvrGroup.obj \
	$(OUT)\TaAfsAdmSvrMain.obj \
	$(OUT)\TaAfsAdmSvrProperties.obj \
	$(OUT)\TaAfsAdmSvrSearch.obj \
	$(OUT)\TaAfsAdmSvrUser.obj \
	$(OUT)\iTaAfsAdmSvr_s.obj

VCLIBS =\
	gdi32.lib \
	user32.lib \
	rpcns4.lib \
	rpcrt4.lib \
	comctl32.lib \
	gdi32.lib

EXELIBS = \
	$(DESTDIR)\lib\afs\AfsClass.lib \
	$(DESTDIR)\lib\afs\TaAfsAppLib.lib \
	$(DESTDIR)\lib\afs\AfsKasAdmin.lib \
	$(DESTDIR)\lib\afs\AfsPtsAdmin.lib \
	$(DESTDIR)\lib\afs\AfsVosAdmin.lib \
	$(DESTDIR)\lib\afs\AfsBosAdmin.lib \
	$(DESTDIR)\lib\afs\AfsAdminUtil.lib \
	$(DESTDIR)\lib\afs\AfsClientAdmin.lib \

############################################################################
#
# IDL COMPILATION
#

MIDL_FLAGS=/ms_ext \
           /app_config \
           /I $(INCFILEDIR) \
           /I . \
           /env win32 \
           /win32 \
           /align 8 \
           /pack 8 \
           /W3 \
           /WX \
	   /no_robust \
           /nologo

.SUFFIXES: .h .idl

.idl.h:
	echo [$<]
	midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) $<

############################################################################

afsapplib_headers :
	$(CD) ..\afsapplib
	nmake /nologo /f ntmakefile headers
	$(CD) ..\afsadmsvr

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

afsapplib_primary :
	$(CD) ..\afsapplib
	nmake /nologo /f ntmakefile primary
	$(CD) ..\afsadmsvr

afsapplib_clean :
	$(CD) ..\afsapplib
	nmake /nologo /f ntmakefile clean
	$(CD) ..\afsadmsvr

afsclass_primary :
	$(CD) ..\afsclass
	nmake /nologo /f ntmakefile primary
	$(CD) ..\afsadmsvr

afsclass_clean :
	$(CD) ..\afsclass
	nmake /nologo /f ntmakefile clean
	$(CD) ..\afsadmsvr

$(EXEFILE) : $(EXEOBJS) $(EXELIBS)
	$(EXECONLINK)  $(VCLIBS)
	$(EXEPREP) 

install : \
	$(IDLFILES) \
	$(INCFILES) \
	afsapplib_headers \
	$(LIBFILE) \
	afsapplib_primary \
	afsclass_primary \
	$(EXEFILE)

clean:: afsclass_clean afsapplib_clean
	if exist ITaAfsAdmSvr*.cpp del ITaAfsAdmSvr*.cpp
	if exist ITaAfsAdmSvr*.c del ITaAfsAdmSvr*.c
	if exist ITaAfsAdmSvr*.h del ITaAfsAdmSvr*.h

############################################################################
#
# Dependencies
#

$(OUT)\AfsAdmSvr.res : AFS_component_version_number.h

mkdir:
	-mkdir $(OUT)\..\afsapplib
	cd ..\afsapplib
	nmake /nologo /f ntmakefile mkdir
	cd ..\afsadmsvr
	-mkdir $(OUT)\..\afsclass
	cd ..\afsclass
	nmake /nologo /f ntmakefile mkdir
	cd ..\afsadmsvr
