Makefile #1

  • //
  • guest/
  • kyle_vanderbeek/
  • webkeeper/
  • Makefile
  • View
  • Commits
  • Open Download .zip Download (1 KB)
##
##  Makefile -- Build procedure for mod_webkeep Apache module
##
##  Contributed to Perforce by Kyle VanderBeek <[email protected]>

# 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

# Get all of apxs's internal values.
CC=gcc #`$(APXS) -q CC`   
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
	g++ -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
	g++ -fPIC -L$(P4API) -shared -o mod_webkeep.so mod_webkeep.o mod_webkeep2.o -lclient -lrpc -lsupp

clean:
	rm -f core *.o *.so
# Change User Description Committed
#2 539 kyle_vanderbeek Huzzah for better documentation!
#1 537 kyle_vanderbeek Working modification