# makefile: Constructs the Kerberos for Windows ticket manager
# Works for both k4 and k5 releases.
#
OBJS	= $(OUTPRE)gss.obj $(OUTPRE)gss-client.obj $(OUTPRE)gss-misc.obj
RESFILE = $(OUTPRE)gss.res
XOBJS	= $(RESFILE)

##### Options
# Set NODEBUG if building release instead of debug
BUILDTOP=..\..
LOCALINCLUDES= /I$(BUILDTOP)\include /I$(BUILDTOP)\include\krb5

##### RC Compiler
RFLAGS	= $(LOCALINCLUDES)
RCFLAGS	= $(RFLAGS) -D_WIN32 -DGSS_APP

##### Linker
LINK	= link
LIBS	= $(GLIB) $(CLIB) $(WLIB)
SYSLIBS	= kernel32.lib wsock32.lib user32.lib gdi32.lib comdlg32.lib
LFLAGS	= /nologo $(LOPTS)

all:: Makefile $(OUTPRE)gss.exe

$(OUTPRE)gss.exe: gss.def $(OBJS) $(XOBJS) $(LIBS)
	$(LINK) $(LFLAGS) /map:$*.map /out:$@ $(OBJS) $(XOBJS) \
	  $(LIBS) $(SYSLIBS)

$(OBJS) $(XOBJS): gss.h

$(RESFILE): ..\version.rc

install::
	copy $(OUTPRE)gss.exe ..\floppy

clean:: 
	if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
	if exist ..\floppy\gss.exe del ..\floppy\gss.exe
	if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
	if exist $(OUTPRE)*.res del $(OUTPRE)*.res
	if exist $(OUTPRE)*.map del $(OUTPRE)*.map
	if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
	if exist *.err del *.err
