##
##  Makefile -- Build file  for mod_curb Apache module
## 
##  This requires apache-dev package to be installed
##

#   the used tools
APXS=apxs
APACHECTL=apachectl
VERSION = 1.1

SHELL = /bin/sh
RM_RF = rm -rf


#   the default target
all: mod_curb.so

#   compile the shared object file
mod_curb.so: mod_curb.c
	$(APXS) -c $(DEF) $(INC) $(LIB) mod_curb.c

#   install the shared object file into Apache 
install: all
	$(APXS) -i -S LIBEXECDIR=$(DESTDIR)/usr/lib/apache/1.3 -n 'curb' mod_curb.so

#   cleanup
clean:
	-rm -f mod_curb.o mod_curb.so *~ codeTest

#   install and activate shared object by reloading Apache to
#   force a reload of the shared object file
reload: install stop start

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

test : test.c
	gcc -o codeTest test.c
