# 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 ..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\config\NTMakefile.version


INCFILEDIR = $(DESTDIR)\include\afs  # header file install directory

INCFILES =\
	$(INCFILEDIR)\auth.h \
	$(INCFILEDIR)\cellconfig.h \
	$(INCFILEDIR)\keys.h


############################################################################
# afsauth.lib

AFSAUTH_LIBFILE = $(DESTDIR)\lib\afs\afsauth.lib

AFSD = ..\WINNT\afsd

AFSAUTH_LIBOBJS =\
	cellconfig.obj \
	userok.obj \
	writeconfig.obj \
	authcon.obj \
	acfg_errors.obj \
	ktc_errors.obj \
	ktc_nt.obj \
	$(AFSD)\afsrpc_c.obj \
	AFS_component_version_number.obj

$(AFSAUTH_LIBFILE): $(AFSAUTH_LIBOBJS)  
	$(LIBARCH) rpcrt4.lib

############################################################################
# afsauth.krb.lib

AFSAUTH_KRB_LIBFILE = $(DESTDIR)\lib\afs\afsauth.krb.lib

AFSAUTH_KRB_LIBOBJS =\
	cellconfig.obj \
	userok.obj \
	writeconfig.obj \
	authcon.obj \
	acfg_errors.obj \
	ktc_errors.obj \
	ktc_nt.obj \
	AFS_component_version_number.obj
	
$(AFSAUTH_KRB_LIBFILE): $(AFSAUTH_KRB_LIBOBJS)  
	$(LIBARCH) rpcrt4.lib

############################################################################
# build setkey

SETKEY_EXEFILE = setkey.exe

SETKEY_EXEOBJS =\
	setkey.obj 

EXELIBDIR = $(DESTDIR)\lib

EXELIBS =\
	$(EXELIBDIR)\afs\afsauth.lib \
	$(DESTDIR)\lib\afsrxkad.lib \
	$(DESTDIR)\lib\afsdes.lib \
	$(EXELIBDIR)\afsrx.lib \
	$(EXELIBDIR)\afslwp.lib \
	$(EXELIBDIR)\afs\afsutil.lib \
	$(DESTDIR)\lib\afs\afseventlog.lib \
	$(EXELIBDIR)\afs\afsreg.lib \
	$(DESTDIR)\lib\cm_dns.obj


$(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
	$(EXECONLINK)
	$(EXEPREP) 

# build copyauth
COPYAUTH_EXEFILE = $(DESTDIR)\etc\copyauth.exe

COPYAUTH_EXEOBJS =\
	copyauth.obj

$(COPYAUTH_EXEFILE): $(COPYAUTH_EXEOBJS) $(EXELIBS) 
	$(EXECONLINK)
	$(EXEPREP) 

acfg_errors.c $(INCFILEDIR)\cellconfig.h : acfg_errors.et cellconfig.p.h
	$(DEL) $(INCFILEDIR)\cellconfig.h  acfg_errors.c
	$(COMPILE_ET) acfg_errors.et -h cellconfig
	$(COPY) cellconfig.h $(INCFILEDIR)\cellconfig.h

ktc_errors.c $(INCFILEDIR)\auth.h: ktc_errors.et auth.p.h
	$(DEL) auth.h ktc_errors.c
	$(COMPILE_ET) ktc_errors.et -h auth
      	$(COPY) auth.h $(INCFILEDIR)\auth.h

install: $(INCFILES) $(AFSAUTH_LIBFILE) setkey.exe # $(COPYAUTH_EXEFILE) $(AFSAUTH_KRB_LIBFILE)

install9x: install

clean::
	$(DEL) acfg_errors.c ktc_errors.c
	$(DEL) $(INCFILEDIR)\auth.h  $(INCFILEDIR)\cellconfig.h
	$(DEL) auth.h  cellconfig.h

setkey: $(SETKEY_EXEFILE)

