# 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

AFSDEV_AUXCDEFINES = -DPMGTEXPORT=__declspec(dllexport)

RELDIR=procmgmt
!INCLUDE ..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\config\NTMakefile.version

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

INCFILES =	$(DESTDIR)\include\afs\procmgmt.h

$(INCFILES):$$(@F)
	$(COPY) $** $(DESTDIR)\include\afs\.

############################################################################
# Build afsprocmgmt.dll

DLLFILE = $(DESTDIR)\root.server\usr\afs\bin\afsprocmgmt.dll
ILIBDIR = $(DESTDIR)\lib\afs

DLLOBJS =\
	$(OUT)\procmgmt_nt.obj \
	$(OUT)\redirect_nt.obj \
	$(OUT)\afsprocmgmt.res

DLLLIBS =\
	$(DESTDIR)\lib\afspthread.lib \
	$(DESTDIR)\lib\afs\afsutil.lib

$(DLLFILE): $(DLLOBJS) $(DLLRES) $(DLLLIBS)
	$(DLLCONLINK) /DEF:afsprocmgmt.def
        $(_VC_MANIFEST_EMBED_DLL)
	$(DLLPREP)
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)
	$(MAKECYGLIB) --input-def afsprocmgmt.def
	$(COPY) $*.lib $(ILIBDIR)
	$(DEL) $*.lib $*.exp

############################################################################
# Build afskill.exe

RS_KILL_EXEFILE = $(DESTDIR)\root.server\usr\afs\bin\afskill.exe
CL_KILL_EXEFILE = $(DESTDIR)\etc\afskill.exe

KILL_EXEOBJS =\
	$(OUT)\afskill.obj \
	$(OUT)\afskill.res

KILL_EXELIBS =\
	$(DESTDIR)\lib\afs\afsprocmgmt.lib

$(RS_KILL_EXEFILE): $(KILL_EXEOBJS)	$(KILL_EXELIBS)
	$(EXECONLINK)
        $(_VC_MANIFEST_EMBED_EXE)
	$(EXEPREP)
        $(CODESIGN_USERLAND)
        $(SYMSTORE_IMPORT)

$(CL_KILL_EXEFILE): $(RS_KILL_EXEFILE)
	$(COPY) $** $@

############################################################################
# Definitions for generating versioninfo resources

#.cpp.obj:
#	$(CPP2OBJ) $<

$(OUT)\afsprocmgmt.res: AFS_component_version_number.h
#	$(RC) $*.rc

$(OUT)\afskill.res: AFS_component_version_number.h
#	$(RC) $*.rc

install_headers: $(INCFILES)

install9x: install_headers

install: install_headers $(DLLFILE) $(CL_KILL_EXEFILE)

clean::
	$(DEL) $(INCFILES)