# Copyright 2004, OpenAFS.ORG 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

# include the primary makefile
AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES)  -DHAVE_KRB5_CREDS_KEYBLOCK=1 -I$(HEIMINC)
RELDIR=WINNT\aklog
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\config\NTMakefile.version

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

AKLOG = $(DESTDIR)\root.client\usr\vice\etc\aklog.exe

AKLOGOBJS = \
	$(OUT)\aklog.obj \
	$(OUT)\linked_list.obj

PTERROBJS=$(OUT)\pterror.obj

$(PTERROBJS): $(AFSROOT)\src\ptserver\pterror.c
	$(C2OBJ) /Fo$@ $**

ASETKEY = $(DESTDIR)\root.server\usr\afs\bin\asetkey.exe

UNIX = ..\..\aklog

ASETKEYOBJS = \
	$(OUT)\asetkey.obj

EXELIBS = \
        $(DESTDIR)\lib\afsrpc.lib \
        $(DESTDIR)\lib\afsauthent.lib \
	$(DESTDIR)\lib\opr.lib \
	$(DESTDIR)\lib\afsroken.lib \
	$(DESTDIR)\lib\afsrpc.lib

OTHERLIBS = dnsapi.lib mpr.lib

$(AKLOGOBJS): $$(@B).c
	$(C2OBJ) $**

$(ASETKEYOBJS): $(UNIX)\$$(@B).c
	$(C2OBJ) $** -I$(UNIX)

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

$(AKLOG) : $(AKLOGOBJS) $(PTERROBJS) $(EXELIBS) $(OUT)\aklog.res $(HEIMDEPS)
	$(EXECONLINK) $(EXELIBS) $(OTHERLIBS) $(HEIMLINKOPTS)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP)
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)

$(ASETKEY) : $(ASETKEYOBJS) $(EXELIBS) $(OUT)\asetkey.res $(HEIMDEPS)
	$(EXECONLINK) $(EXELIBS) $(OTHERLIBS) $(HEIMLINKOPTS)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP)
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)

install : $(COPYHEADERS) $(AKLOG) $(ASETKEY)

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

$(OUT)\aklog.res : aklog.rc AFS_component_version_number.h

$(OUT)\asetkey.res : asetkey.rc AFS_component_version_number.h

$(OUT)\k5log.res : k5log.rc AFS_component_version_number.h

mkdir:
	-mkdir $(OUT)\lang
	cd lang
	nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
	cd ..

