#
# $Id: //devel/tools/main/rfc868time/makefile#3 $
#
# written by :	Stephen J. Friedl
#		Software Consultant
#		steve@unixwiz.net
#
#	This is the main makefile for our rotating password system.
#	Just type "make" and it should rebuild everything, even after
#	changing the key or word list.
#
#	Before building on NT, make sure that the VARS.BAT file has
#	been configured with the location of the C compiler and run
#	to populate the environment
#
#	===NOTE: this is the Microsoft Visual C++ version only for NT


# ------------------------------------------------------------------------
# SET C COMPILER AND FLAGS
#
#	UNIX typically uses "cc" or "gcc" for the C compiler, and on
#	NT it works best with "cl". The compiler flags are different
#	too, so they are set in one place.
#
#	-nologo		suppress the Microsoft copyright message
#
#	-WX		warnings are treated as errors
#
#	-W3		lots of warnings
#
#	-MD		link with use MSVCRT.DLL
#
#	-DWIN32_LEAN_AND_MEAN	skips a LOT of stuff in <windows.h>
#
# this is required for the MD5 builds
CFLAGS	= -DWIN32_LEAN_AND_MEAN -WX -W3 -MD /YXwindows.h -DUNICODE -D_UNICODE
CPPFLAGS = $(CFLAGS)

CC=cl -nologo
CPP=cl -nologo

# ------------------------------------------------------------------------
# LIST OF ALL TARGETS
#
#
ALL = rfc868time.exe

CLEAN	= *.obj *.pch
CLOBBER = $(ALL)

all : $(ALL)

RFC868TIME = rfc868time.obj service.obj odprintf.obj $(KEYS) 

rfc868time.exe : $(RFC868TIME)
	link /nologo /out:$@ $(RFC868TIME) advapi32.lib Ws2_32.lib kernel32.lib

clean :
	-rm -f $(CLEAN)

clobber : clean
	-rm -f $(CLOBBER)

%.obj : %.cpp
	$(CPP) -c $(CFLAGS) $*.cpp

SOURCE= makefile \
	defs.h \
	odprintf.cpp rfc868time.cpp service.cpp

rfc868time-source.zip : $(SOURCE)
	pkzipc -add $@ $(SOURCE)

# just for S. Friedl's developmenthere
web : rfc868time.exe rfc868time-source.zip
	perl ../putwebtool.p --tool=rfc868time --verquery=-version

