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

####################################################################
# install  comerr header files 
INCFILEDIR = $(DESTDIR)\include\afs
INCFILES =\
	$(INCFILEDIR)\com_err.h \
	$(INCFILEDIR)\error_table.h \
	$(INCFILEDIR)\mit-sipb-cr.h 

####################################################################
# build and install  afscom_err.lib static lib
COMERR_LIBFILE = $(DESTDIR)\lib\afs\afscom_err.lib

COMERR_LIBOBJS =\
		$(OUT)\error_msg.obj  \
		$(OUT)\et_name.obj  \
		$(OUT)\com_err.obj \
		$(OUT)\AFS_component_version_number.obj
		
$(COMERR_LIBOBJS): $$(@B).c
    $(C2OBJ) $**

$(COMERR_LIBFILE): $(COMERR_LIBOBJS)
	$(LIBARCH)  

####################################################################
# build and install the compile_et executable
COMPILE_ET_EXEFILE = $(DESTDIR)\bin\compile_et.exe

COMPILE_ET_EXERES  = $(OUT)\compile_et.res

prep:
	$(DESTDIR)\bin\touch et_lex.lex_nt.c
	$(DESTDIR)\bin\touch error_table_nt.c
	@echo If you update et_lex.lex.l, to build correctly, you should delete error_table_nt.c 

et_lex.lex_nt.c:   et_lex.lex.l
    $(LEX) -t et_lex.lex.l > $@	

error_table_nt.c:  et_lex.lex_nt.c error_table.y
    $(YACC) -d -o $@ error_table.y

COMPILE_ET_EXEOBJS =\
		$(OUT)\compile_et.obj \
		$(OUT)\error_table_nt.obj

$(COMPILE_ET_EXERES): compile_et.rc AFS_component_version_number.h

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

COMPILE_ET_EXELIBS =\
	$(DESTDIR)\lib\afs\afsutil.lib

$(COMPILE_ET_EXEFILE): $(COMPILE_ET_EXEOBJS) $(COMPILE_ET_EXERES) $(COMPILE_ET_EXELIBS)  
	$(EXECONLINK)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP) 
        $(CODESIGN_USERLAND)

####################################################################
install: prep $(INCFILES) $(COMERR_LIBFILE) $(COMPILE_ET_EXEFILE) 

install9x: install

clean::
	$(DEL) $(COMERR_LIBFILE) $(OUT)\AFS_component_version_number.obj
	$(DEL) $(COMPILE_ET_EXEFILE)
	$(DEL) $(COMPILE_ET_EXERES);
	$(DEL) *~ *.bak \
                 *.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
                 *.cp *.fn *.ky *.log *.pg *.tp *.vr \
                 et.ar TAGS

test:

mkdir:
