2 ## Apache 1.3 Makefile template for PHP 4.0 Module
3 ## [src/modules/php5/Makefile.tmpl]
6 # the parametrized target
9 # objects for building the static library
13 # objects for building the shared object library
14 SHLIB_OBJS=mod_php5.so-o
15 SHLIB_OBJS_LIB=libmodphp5.a
21 # build the static library by merging the object files
22 libphp5.a: $(OBJS) $(OBJS_LIB)
27 # ugly hack to support older Apache-1.3 betas that don't set $LIBEXT
28 libphp5.: $(OBJS) $(OBJS_LIB)
34 # build the shared object library by linking the object files
35 libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB)
37 $(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS) $(PHP_LIBS)
39 # 1. extension .o for shared objects cannot be used here because
40 # first these files aren't still shared objects and second we
41 # have to use a different name to trigger the different
43 # 2. extension -so.o (as used elsewhere) cannot be used because
44 # the suffix feature of Make really wants just .x, so we use
48 $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $<
50 $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o
54 -rm -f $(OBJS) $(SHLIB_OBJS) $(LIB)
56 # We really don't expect end users to use this rule. It works only with
57 # gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after
60 cp Makefile.tmpl Makefile.tmpl.bak \
61 && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
62 && gcc -MM $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) *.c >> Makefile.new \
63 && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \
72 mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \
74 $(INCDIR)/http_config.h \
75 $(INCDIR)/http_core.h $(INCDIR)/http_main.h \
76 $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \
77 $(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php5.h