Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6cd6a74c5a
Fetching contributors…

Cannot retrieve contributors at this time

file 77 lines (64 sloc) 2.319 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
##
## Apache 1.3 Makefile template for PHP 4.0 Module
## [src/modules/php5/Makefile.tmpl]
##

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

# objects for building the static library
OBJS=mod_php5.o
OBJS_LIB=libmodphp5.a

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

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

# build the static library by merging the object files
libphp5.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
libphp5.: $(OBJS) $(OBJS_LIB)
cp $(OBJS_LIB) $@
ar r $@ $(OBJS)
$(RANLIB) $@
cp libphp5. libphp5.a

# build the shared object library by linking the object files
libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB)
rm -f $@
$(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_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) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $<
.c.so-o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(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) $(PHP_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_php5.o: mod_php5.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_php5.h
Something went wrong with that request. Please try again.