#
# $Id: //devel/tools/main/fastzolver/Makefile#2 $
#
# written by:  Stephen J. Friedl
#              Software Consultant
#              Tustin, California USA
#              http://www.unixwiz.net/tools/fastzolver.html
#
#	This is the makefile for the fastzolver program, which is a fast
#	DNS resolver companion to The Webalizer. This requires GNU make,
#	and though its probably portable to Win32 with some effort, we've
#	not done this yet.
#
# COMPILE OPTIONS
# ---------------
#
# -DSUPPORT_ZLIB
#
#	This enables support for the ZLIB decompression; we use this to
#	be able to read a compressed logfile (access_log.gz). Without
#	this, we can only process straight ASCII.
#
# -DENABLE_CACHE_REMOVE
#
#	For testing, we support a -R parameter which removes the DNS cache
#	file before each run; this has no value for production software
#	and is disabled by default.
#

CPP=g++

CFLAGS = -W -Wall --pedantic -ggdb -g
CFLAGS += -DSUPPORT_ZLIB

first : fastzolver

CLEAN += fastzolver fastzolver.o
fastzolver : fastzolver.o
	$(CPP) -o $@ $^ -L /usr/local/lib -ldb -ladns -lz

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

clean :
	-rm -f $(CLEAN)

#------------------------------------------------------------------------
# WEB DEPLOYMENT
#
#	We wish to deploy our source bundles to the webserver for
#	publication, and "putwebtool" does this while attaching
#	a version number.
#

TARBALL=fastzolver-source.tgz

CLEAN += $(TARBALL)

$(TARBALL) : fastzolver.cpp makefile
	gtar -czvf $@ $^

web : $(TARBALL)
	perl ../putwebtool.p --tarball=fastzolver
