##
##  Makefile -- Build procedure for sample vhost_mysql Apache module
##  Autogenerated via ``apxs -n vhost_mysql -g''.
##

#   the used tools
APXS=apxs2
APACHECTL=apache2ctl

#   additional user defines, includes and libraries
#DEF=-Dmy_define=my_value
INC=`mysql_config --include`
#INC=`mysql_config --cflags`
LIB=`mysql_config --libs`

#   the default target
all: mod_vhost_mysql.so

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

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

#   cleanup
clean:
	-rm -f mod_vhost_mysql.o mod_vhost_mysql.so

#   simple test
test: reload
	lynx -mime_header http://localhost/vhost_mysql

#   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

