# 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

# include the AFSD source tree on our inclusion path

AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\afsd -I..\client_config -I..\kfw\inc\krb5 

# include the primary makefile
RELDIR=WINNT\client_creds
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\config\NTMakefile.version

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

EXEFILE = $(DESTDIR)\root.client\usr\vice\etc\afscreds.exe

EXEOBJS = \
	$(OUT)\advtab.obj \
	$(OUT)\afswiz.obj \
	$(OUT)\creds.obj \
	$(OUT)\main.obj \
	$(OUT)\misc.obj \
	$(OUT)\credstab.obj \
	$(OUT)\mounttab.obj \
	$(OUT)\settings.obj \
	$(OUT)\shortcut.obj \
	$(OUT)\trayicon.obj \
	$(OUT)\window.obj

EXECOBJS = \
    $(OUT)\ipaddrchg.obj

EXERES = \
	$(OUT)\afscreds_stub.res

AFSDOBJS = \
	$(OUT)\fs_utils.obj
	
CLIENTOBJS = \
	$(OUT)\drivemap.obj \
    	$(OUT)\RegistrySupport.obj 

VCLIBS =\
    	iphlpapi.lib \
	comctl32.lib \
	shell32.lib \
	uuid.lib \
	ole32.lib \
	mpr.lib \
	userenv.lib \
    	netapi32.lib \
        secur32.lib 

EXELIBS = \
	$(DESTDIR)\lib\afs\afspioctl.lib \
	$(DESTDIR)\lib\libosi.lib \
	$(DESTDIR)\lib\afs\TaAfsAppLib.lib \
    	$(DESTDIR)\lib\lanahelper.lib \
    	$(DESTDIR)\lib\afsrxkad.lib \
    	$(DESTDIR)\lib\afsdes.lib \
	$(DESTDIR)\lib\afsauthent.lib \
	$(DESTDIR)\lib\libafsconf.lib \
	$(DESTDIR)\lib\afs\afsreg.lib \
    	$(DESTDIR)\lib\afskfw.lib

############################################################################
#
# EXTERNAL SOURCE FILES
#
# The following source files are required by this application, but live
# elsewhere in the tree. To prevent checking in more than one copy of the
# source files, they are copied to this directory at build-time.
#

COPYHEADERS = \
	$(DESTDIR)\include\WINNT\al_wizard.h \
	$(DESTDIR)\include\WINNT\checklist.h \
	$(DESTDIR)\include\WINNT\subclass.h

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

AFSD = ..\afsd
AFSAPPLIB=..\afsapplib
CLIENT= ..\client_config

$(CLIENTOBJS): $(CLIENT)\$$(@B).cpp
	$(C2OBJ) -I$(*D) $**

$(AFSDOBJS): $(AFSD)\$$(@B).c
	$(C2OBJ) -I$(*D) $**

$(EXEOBJS): $$(@B).cpp
	$(C2OBJ) -I$(*D) -I$(AFSAPPLIB) $**

$(EXECOBJS): $$(@B).c
	$(C2OBJ) -I$(*D) -I$(AFSAPPLIB) $**

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

$(EXEFILE) : $(EXEOBJS) $(EXECOBJS) $(EXERES) $(AFSDOBJS) $(CLIENTOBJS) $(EXELIBS) 
	$(EXEGUILINK) $(VCLIBS)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP) 
        $(CODESIGN_USERLAND)

install : $(COPYHEADERS) $(EXEFILE) lang

lang ::
	$(CD) lang
	for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
	$(CD) ..

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

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

clean::
	$(CD) lang
        @if exist AFS_component_version_number.h del AFS_component_version_number.h
	for /f %l in ('dir /B ??_??') do ( if exist @$(NTLANG) do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile clean )
	$(CD) ..

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

