#
#	Makefile - for getstats, et al.
#
#ident	"@(#)getstats:local-1_2-v0:Makefile,v 1.1 1996/12/05 17:04:20 woods Exp"

LOCAL =		/local

LINC =		$(LOCAL)/include
LLIB =		$(LOCAL)/lib
HTTP_ROOT =	$(LOCAL)/httpd
HTTP_CONF =	$(HTTP_ROOT)/conf
CGI_BIN =	$(HTTP_ROOT)/cgi-bin
IMAGES =	$(HTTP_ROOT)/images
DOCUMENT_ROOT = $(HTTP_ROOT)/htdocs

SDB =#		-g
OPTIM =		-O
DEFINES =#	-DDEBUG

CFLAGS =	$(SDB) $(OPTIM) $(DEFINES) -I$(LINC)
LFLAGS =	$(SDB) $(OPTIM) -L$(LLIB)

LOADLIBES =	-lcgi

INSTALL =	install
INSTALL_PROG =	$(INSTALL) -m 755
INSTALL_DATA =	$(INSTALL) -m 644

all: getstats statform getstats.gif

getstats: getstats.c #getstats.h
	$(CC) $(CFLAGS) $(LFLAGS) -o $@ getstats.c

statform: statform.c #statform.h
	$(CC) $(CFLAGS) $(LFLAGS) -o $@ statform.c $(LOADLIBES)

getstats.gif: getstats.xbm
	-rm -f $@
	xbm2gif $?.xbm > $@

# WARNING:  you might want to deny access to cgi-bin/getstats,
# and optionally cgi-bin/statform, with an .htaccess file...
#
install: all
	$(INSTALL_PROG) getstats $(CGI_BIN)
	$(INSTALL_DATA) getstats.gif $(IMAGES)
	$(INSTALL_DATA) getstats.html $(DOCUMENT_ROOT)
	$(INSTALL_DATA) domain.codes.txt $(HTTP_CONF)
	$(INSTALL_PROG) statform $(CGI_BIN)
	$(INSTALL_DATA) statform.html $(DOCUMENT_ROOT)
