# 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

RELDIR=auth
!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 =\
	$(OUT)\cellconfig.obj \
	$(OUT)\userok.obj \
	$(OUT)\writeconfig.obj \
	$(OUT)\authcon.obj \
	$(OUT)\acfg_errors.obj \
	$(OUT)\ktc_errors.obj \
	$(OUT)\ktc_nt.obj \
	$(OUT)\AFS_component_version_number.obj

AFSDOBJS =\
	$(OUT)\$(AFSD)\afsrpc_c.obj

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

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

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

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

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

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

SETKEY_EXEFILE = $(OUT)\setkey.exe

SETKEY_EXEOBJS =\
	$(OUT)\setkey.obj 

EXELIBDIR = $(DESTDIR)\lib

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


$(SETKEY_EXEFILE): $(SETKEY_EXEOBJS) $(EXELIBS)
	$(EXECONLINK) dnsapi.lib
	$(EXEPREP) 

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

COPYAUTH_EXEOBJS =\
	$(OUT)\copyauth.obj

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

$(INCFILES):$$(@F)
	 $(COPY)  $** $(INCFILEDIR)\.

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

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

install_headers: $(INCFILES)

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

install9x: install

clean::
	$(DEL) acfg_errors.c ktc_errors.c
	$(DEL) $(INCFILES) $(AFSAUTH_LIBFILE)
	$(DEL) auth.h  cellconfig.h

setkey: $(SETKEY_EXEFILE)

mkdir:
	
