# 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_$(CPU)_c.obj

EXERES = $(OUT)\AfsAdmSvr.res


$(EXERES): AfsAdmSvr.rc AFS_component_version_number.h

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_$(CPU)_s.obj

VCLIBS =\
	gdi32.lib \
	user32.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 . \
           /align 8 \
           /pack 8 \
           /W3 \
           /WX \
           /nologo

ITaAfsAdmSvr.h ITaAfsAdmSvr_$(CPU)_c.c ITaAfsAdmSvr_$(CPU)_s.c: ITaAfsAdmSvr.idl
	midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) -cstub ITaAfsAdmSvr_$(CPU)_c.c -sstub ITaAfsAdmSvr_$(CPU)_s.c $**

ITaAfsAdmSvrTypes.h ITaAfsAdmSvrTypes_$(CPU)_c.c ITaAfsAdmSvrTypes_$(CPU)_s.c: ITaAfsAdmSvrTypes.idl
	midl $(MIDL_FLAGS) $(AFSDEV_AUXMIDLFLAGS) -cstub ITaAfsAdmSvrTypes_$(CPU)_c.c -sstub ITaAfsAdmSvrTypes_$(CPU)_s.c $**

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

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) $(EXERES) $(EXELIBS)
	$(EXECONLINK)  $(VCLIBS)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP)
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)

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

clean:: afsclass_clean afsapplib_clean
	$(DEL) ITaAfsAdmSvr_$(CPU)_c.c ITaAfsAdmSvr_$(CPU)_s.c ITaAfsAdmSvr.h
	$(DEL) ITaAfsAdmSvrTypes_$(CPU)_c.c ITaAfsAdmSvrTypes_$(CPU)_s.c ITaAfsAdmSvrTypes.h
	$(DEL) AFS_component_version_number.h
	$(DEL) $(EXERES)

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

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
