## ## Makefile -- APXS build procedure for mod_webkeep Apache module ## ## Based on the contribution to Perforce by Kyle VanderBeek # Change this to the location where you un-tar'ed the p4api.tar P4API_HEADERS=/Users/matt/clients/public/webkeeper/p4api/include/p4 P4API_LIBS=/Users/matt/clients/public/webkeeper/p4api/lib # Change this to where your apxs (from Apache) program is APXS=/usr/sbin/apxs # Pick your compilers CXX=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 $(CXX) -c -fPIC -I. -I $(P4API_HEADERS) -I$(APXS_INCLUDEDIR) $(APXS_CFLAGS) -Wall -o $@ $< mod_webkeep.o: mod_webkeep.c gcc -fPIC -DSHARED_MODULE -I/usr/include/apr-1 -I$(APXS_INCLUDEDIR) -I. $(APXS_CFLAGS) -o $@ -c $< # link with g++ instead of apxs so that we get all the C++ bits we need mod_webkeep.so: mod_webkeep2.o mod_webkeep.o $(CXX) -fPIC -shared -o $@ mod_webkeep.o mod_webkeep2.o -L$(P4API_LIBS) -lclient -lrpc -lsupp $(APXS_LIBS_SHLIB) clean: rm -f core *.o *.so *.slo *.lo *.la