##
## Makefile -- Build procedure for mod_webkeep Apache module
##
## Contributed to Perforce by Kyle VanderBeek <kylev@yaga.com>
# Change this to the location where you un-tar'ed the p4api.tar
P4API=/home/kylev/perforce/kylev/p4api
# Change this to where your apxs (from Apache) program is
APXS=/usr/sbin/apxs
# Pick your compilers
CC=gcc
CPP=g++
##### NO CHANGES should be needed below this line
#####--------------------------------------------
# Get all of apxs's internal values.
APXS_TARGET=`$(APXS) -q TARGET`
APXS_CFLAGS=`$(APXS) -q CFLAGS`
APXS_SBINDIR=`$(APXS) -q SBINDIR`
APXS_CFLAGS_SHLIB=`$(APXS) -q CFLAGS_SHLIB`
APXS_INCLUDEDIR=`$(APXS) -q INCLUDEDIR`
APXS_LD_SHLIB=`$(APXS) -q LD_SHLIB`
APXS_LIBEXECDIR=`$(APXS) -q LIBEXECDIR`
APXS_LDFLAGS_SHLIB=`$(APXS) -q LDFLAGS_SHLIB`
APXS_SYSCONFDIR=`$(APXS) -q SYSCONFDIR`
APXS_LIBS_SHLIB=`$(APXS) -q LIBS_SHLIB`
# the default target
all: mod_webkeep.so
# compile the shared object file. use g++ instead of letting apxs call
# ld so we end up with the right c++ stuff. We do this in two steps,
# compile and link.
# compile
mod_webkeep2.o: mod_webkeep2.cc mod_webkeep.h
$(CPP) -c -fPIC -I. -I$(P4API) $(APXS_CFLAGS) $(APXS_CFLAGS_SHLIB) -Wall -o $@ $<
mod_webkeep.o: mod_webkeep.c mod_webkeep.h
$(CC) $(APXS_CFLAGS) $(APXS_CFLAGS_SHLIB) -I$(APXS_INCLUDEDIR) -I$(P4API) -Wall -c $<
mod_webkeep.so: mod_webkeep.o mod_webkeep2.o
$(CPP) -fPIC -L$(P4API) -shared -o mod_webkeep.so mod_webkeep.o mod_webkeep2.o -lclient -lrpc -lsupp
clean:
rm -f core *.o *.so