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

#   the used tools
APXS=apxs
APACHECTL=wwwctl

#  additional user defines, includes and libraries
#DEF=-Dmy_define=my_value
INC=-I /usr/local/include -I ./include
LIB=-L /usr/local/lib -lpq
# LIB=-L /usr/local/lib/libpq.a 

SRC1= src/twodim.c src/util.c src/psql.c src/multipart_buffer.c src/apache_request.c src/form.c

SRC2= src/db_shrs.c 

SRC3 = src/form_menus.c src/form_admin.c src/form_request.c src/jscript.c src/form_summary.c src/shrs.c src/mod_jda.c

#   the default target
all: mod_jda.so

#   compile the DSO file
mod_jda.so: $(SRC) Makefile
	$(APXS) -o $@ -c $(DEF) $(INC) $(LIB) $(SRC1) $(SRC2) $(SRC3) $(SRC4)

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

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

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

#   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

