##
##  Makefile -- Build procedure for WebKit Apache module
##  Can also be autogenerated via ``apxs -n webkit -g''.
##

#   the used tools

#APXS=apxs
APXS=/usr/sbin/apxs
#APXS=/usr/local/apache2/bin/apxs
#APXS=apxs2
#APXS=/usr/sbin/apxs2

APACHECTL=apachectl
#APACHECTL=/usr/sbin/apachectl
#APACHECTL=apache2ctl
#APACHECTL=/usr/sbin/apache2ctl

#CC=`$(APXS) -q CC`
#INC=`$(APXS) -q INCLUDEDIR`
#CFLAGS=`$(APXS) -q CFLAGS CFLAGS_SHLIB`
#LDFLAGS=`$(APXS) -q LDFLAGS LDFLAGS_SHLIB`

#   If you want to build a Universal Binary on Mac OS X:
#CFLAGS=-arch x86_64 -arch ppc -arch i386
#LDFLAGS=$(CFLAGS)

#   You can pass authorization information (passwords)
#   from Apache to WebKit, even if Apache has not been
#   compiled with this feature, by defining the following:
#DEF=-DSECURITY_HOLE_PASS_AUTHORIZATION

SRC = mod_webkit.c marshal.c

#   the default target
all: mod_webkit.la

#   compile the DSO file
mod_webkit.la: $(SRC)
	$(APXS) -c -Wc,"$(CFLAGS)" -o mod_webkit.la $(DEF) $(SRC) $(LDFLAGS)

#   install the DSO file into the Apache installation
#   and activate it in the Apache configuration
install: all
	$(APXS) -i -n webkit mod_webkit.la

#   install and activate it in the Apache configuration
activate: all
	$(APXS) -i -a -n webkit mod_webkit.la

#   cleanup
clean:
	-rm -rf *.o *.lo *.slo *.la .libs

#   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
