K2.6 patches and update.
[tomato.git] / release / src / router / php / sapi / apache_hooks / apMakefile.tmpl
blob4054e8e119533baebb85198012e4f0545b3a7be4
1 ##
2 ##  Apache 1.3 Makefile template for PHP 4.0 Module
3 ##  [src/modules/php5/Makefile.tmpl]
4 ##
6 #   the parametrized target
7 LIB=libphp5.$(LIBEXT)
9 #   objects for building the static library
10 OBJS=mod_php5.o
11 OBJS_LIB=libmodphp5.a
13 #   objects for building the shared object library
14 SHLIB_OBJS=mod_php5.so-o
15 SHLIB_OBJS_LIB=libmodphp5.a
17 #   the general targets
18 all: lib
19 lib: $(LIB)
21 #   build the static library by merging the object files
22 libphp5.a: $(OBJS) $(OBJS_LIB)
23         cp $(OBJS_LIB) $@
24         ar r $@ $(OBJS)
25         $(RANLIB) $@
27 #   ugly hack to support older Apache-1.3 betas that don't set $LIBEXT
28 libphp5.: $(OBJS) $(OBJS_LIB)
29         cp $(OBJS_LIB) $@
30         ar r $@ $(OBJS)
31         $(RANLIB) $@
32         cp libphp5. libphp5.a
34 #   build the shared object library by linking the object files
35 libphp5.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB)
36         rm -f $@
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
42 #    implicit Make rule
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
45 #    extension .so-o
46 .SUFFIXES: .o .so-o
47 .c.o:
48         $(CC) -c $(INCLUDES) $(CFLAGS) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $<
49 .c.so-o:
50         $(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(PHP_CFLAGS) $(CPPFLAGS) $(SPACER) $< && mv $*.o $*.so-o
52 #   cleanup
53 clean:
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
58 # using it.
59 depend:
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 \
64                 > Makefile.tmpl \
65             && rm Makefile.new
67 #Dependencies
69 $(OBJS): Makefile
71 # DO NOT REMOVE
72 mod_php5.o: mod_php5.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \
73  $(INCDIR)/buff.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