## $Id: Makefile,v 1.3 2001/12/30 14:11:43 tellini Exp $
##
##  Makefile -- Build procedure for sample mod_accounting Apache module
##  Autogenerated via ``apxs -n accounting -g''.
##

#   the used tools
APXS=apxs
APACHECTL=apachectl

#   here's what you may need to change
DEF=-DNEED_POSTGRES -DNEED_MYSQL
INC=-I/usr/local/pgsql/include/ -I/usr/local/mysql/include/
LIB=-L/usr/local/pgsql/lib -lpq -L/usr/local/mysql/lib/mysql/ -lmysqlclient

#   the default target
all: mod_accounting.so

#   compile the DSO file
mod_accounting.so: mod_accounting.c postgres.c mysql.c
	$(APXS) -c $(DEF) $(INC) $(LIB) mod_accounting.c postgres.c mysql.c

#   install the DSO file into the Apache installation
#   and activate it in the Apache configuration
install: all
	$(APXS) -i -a -n 'accounting' mod_accounting.so

#   cleanup
clean:
	-rm -f *.o *.so *.bak

#   reload the module by installing and restarting Apache
reload: install restart

#   the general Apache start/restart/stop procedures
start:
	$(APACHECTL) start
restart:
	$(APACHECTL) restart
stop:
	$(APACHECTL) stop

# my quick debug stuff
test: install stop start
	apachectl status
	tail /usr/local/apache/logs/error_log
