##
##  Apache Makefile, automatically generated by Configure script.
##  Hand-edited changes will be lost if the Configure script is re-run.
##  Sources: - ../../Makefile.config (via Configuration.apaci)
##           - ./Makefile.tmpl
##

##
##  Inherited Makefile options from Configure script
##  (Begin of automatically generated section)
##
SRCDIR=../..
EXTRA_CFLAGS=`$(SRCDIR)/apaci`
EXTRA_LDFLAGS=
EXTRA_LIBS=
EXTRA_INCLUDES=
EXTRA_DEPS=
OSDIR=$(SRCDIR)/os/unix
INCDIR=$(SRCDIR)/include
INCLUDES0=-I$(OSDIR) -I$(INCDIR)
SHELL=/bin/sh
OS=BeOS BONE
CC=gcc
CPP=gcc -E
TARGET=httpd
OPTIM=
CFLAGS1= -DBONE -I/boot/home/files/code/php-4.0.6 -I/boot/home/files/code/php-4.0.6/main -I/boot/home/files/code/php-4.0.6/main -I/boot/home/files/code/php-4.0.6/Zend -I/boot/home/files/code/php-4.0.6/Zend -I/boot/home/files/code/php-4.0.6/TSRM -I/boot/home/files/code/php-4.0.6/TSRM -I/boot/home/files/code/php-4.0.6 -DUSE_EXPAT -I$(SRCDIR)/lib/expat-lite -DNO_DL_NEEDED
INCLUDES1=
LIBS_SHLIB=
LDFLAGS1=
MFLAGS_STATIC=--no-print-directory
REGLIB=
EXPATLIB=lib/expat-lite/libexpat.a
RANLIB=ranlib
LIBS1=  -Wl,-rpath,/boot/home/config/lib -Wl,-rpath,/boot/apps/www/postgresql/lib  -L/boot/home/config/lib -L/boot/apps/www/postgresql/lib -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4   -lpq -lz -lssl -lcrypto -lbind -lsocket  -lbe -lroot  -lbind -lsocket -lbe -lroot
##
##  (End of automatically generated section)
##

##
##  Default Makefile options from Configure script
##  (Begin of automatically generated section)
##
CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
INCDIR=$(SRCDIR)/include
LIBEXT=a
##
##  (End of automatically generated section)
##
##
##  Apache 1.3 Makefile template for PHP 4.0 Module
##  [src/modules/php4/Makefile.tmpl]
##

#   the parametrized target
LIB=libphp4.$(LIBEXT)

#   objects for building the static library
OBJS=mod_php4.o
OBJS_LIB=libmodphp4.a

#   objects for building the shared object library
SHLIB_OBJS=mod_php4.so-o
SHLIB_OBJS_LIB=libmodphp4.a

#   the general targets
all: lib
lib: $(LIB)

#   build the static library by merging the object files
libphp4.a: $(OBJS) $(OBJS_LIB)
	cp $(OBJS_LIB) $@
	ar r $@ $(OBJS)
	$(RANLIB) $@

#   ugly hack to support older Apache-1.3 betas that don't set $LIBEXT
libphp4.: $(OBJS) $(OBJS_LIB)
	cp $(OBJS_LIB) $@
	ar r $@ $(OBJS)
	$(RANLIB) $@
	cp libphp4. libphp4.a

#   build the shared object library by linking the object files
libphp4.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB)
	rm -f $@
	$(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS)

# 1. extension .o for shared objects cannot be used here because
#    first these files aren't still shared objects and second we
#    have to use a different name to trigger the different
#    implicit Make rule
# 2. extension -so.o (as used elsewhere) cannot be used because
#    the suffix feature of Make really wants just .x, so we use
#    extension .so-o
.SUFFIXES: .o .so-o
.c.o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(SPACER) $<
.c.so-o:
	$(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o

#   cleanup
clean:
	-rm -f $(OBJS) $(SHLIB_OBJS) $(LIB)

# We really don't expect end users to use this rule.  It works only with
# gcc, and rebuilds Makefile.tmpl.  You have to re-run Configure after
# using it.
depend:
	cp Makefile.tmpl Makefile.tmpl.bak \
	    && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
	    && gcc -MM $(INCLUDES) $(CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \
	    && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \
		> Makefile.tmpl \
	    && rm Makefile.new

#Dependencies

$(OBJS): Makefile

# DO NOT REMOVE
mod_php4.o: mod_php4.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \
 $(INCDIR)/buff.h \
 $(INCDIR)/http_config.h \
 $(INCDIR)/http_core.h $(INCDIR)/http_main.h \
 $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \
 $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php4.h
