Configuring and Managing MPE/iX Internet Services (August 2002)
Chapter 9
HP WebWise MPE/iX Secure Web Server
Sample Module Code (mod_hw)
179
APXS Default Makefile (mod_hw)
This is the Makefile auto-generated by apxs -g -n hw.
##
## Makefile -- Build procedure for sample hw Apache module
## Autogenerated via ‘‘apxs -n hw -g’’.
##
# the used tools
APXS=apxs
APACHECTL=apachectl
# additional defines, includes and libraries
#DEF=-Dmy_define=my_value
#INC=-Imy/include/dir
#LIB=-Lmy/lib/dir -lmylib
# the default target
all: mod_hw.so
# compile the shared object file
mod_hw.so: mod_hw.c
$(APXS) -c $(DEF) $(INC) $(LIB) mod_hw.c
# install the shared object file into Apache
install: all
$(APXS) -i -a -n ’hw’ mod_hw.so
# cleanup
clean:
-rm -f mod_hw.o mod_hw.so
# simple test
test: reload
lynx -mime_header http://localhost/hw
# install and activate shared object by reloading Apache to
# force a reload of the shared object file
reload: install restart
# the general Apache start/restart/stop
# procedures
start:
$(APACHECTL) start
restart:
$(APACHECTL) restart
stop:
$(APACHECTL) stop
Modified APXS Makefile (mod_hw)
This Makefile is a modified version of the apxs auto-generated Makefile. It shows how to call gcc for
compiling and LinkEditor for linking. The APXS variable was also changed to contain a fully qualified path
to apxs. Apxs is used for getting the correct defines and includes. It is also used for installing the new module
in the libexec/ directory.