1 mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
2 INSTALL = $(top_srcdir)/build/shtool install -c
3 INSTALL_DATA = $(INSTALL) -m 644
5 DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
6 COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
10 @echo "Build complete."
11 @echo "Don't forget to run 'make test'."
14 build-modules: $(PHP_MODULES)
16 libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
17 $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
18 -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
20 libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
21 $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
23 install: $(all_targets) $(install_targets)
25 install-sapi: $(OVERALL_TARGET)
26 @echo "Installing PHP SAPI module: $(PHP_SAPI)"
27 -@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
28 -@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
29 for i in 0.0.0 0.0 0; do \
30 if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
31 $(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \
38 install-modules: build-modules
40 $(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
41 @echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/"
42 @rm -f modules/*.la >/dev/null 2>&1
43 @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
46 -@if test "$(INSTALL_HEADERS)"; then \
47 for i in `echo $(INSTALL_HEADERS)`; do \
48 i=`$(top_srcdir)/build/shtool path -d $$i`; \
49 paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
51 $(mkinstalldirs) $$paths && \
52 echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
53 for i in `echo $(INSTALL_HEADERS)`; do \
54 if test "$(PHP_PECL_EXTENSION)"; then \
55 src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
59 if test -f "$(top_srcdir)/$$src"; then \
60 $(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
61 elif test -f "$(top_builddir)/$$src"; then \
62 $(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
64 (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \
65 cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
70 PHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'
71 PHP_TEST_SHARED_EXTENSIONS = ` \
72 if test "x$(PHP_MODULES)" != "x"; then \
73 for i in $(PHP_MODULES)""; do \
74 . $$i; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
79 -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
80 TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
81 TEST_PHP_SRCDIR=$(top_srcdir) \
83 $(PHP_EXECUTABLE) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -U -d extension_dir=modules/ $(PHP_TEST_SHARED_EXTENSIONS) tests/; \
84 elif test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
85 INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
86 if test "$$INI_FILE"; then \
87 $(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
89 echo > $(top_builddir)/tmp-php.ini; \
91 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
92 TEST_PHP_SRCDIR=$(top_srcdir) \
94 $(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -U -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
96 echo "ERROR: Cannot run tests without CLI sapi."; \
100 -@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
101 INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
102 if test "$$INI_FILE"; then \
103 $(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
105 echo > $(top_builddir)/tmp-php.ini; \
107 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
108 TEST_PHP_SRCDIR=$(top_srcdir) \
110 $(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -u -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
112 echo "ERROR: Cannot run tests without CLI sapi."; \
116 -@if test ! -z "$(SAPI_CLI_PATH)" && test -x "$(SAPI_CLI_PATH)"; then \
117 INI_FILE=`$(top_builddir)/$(SAPI_CLI_PATH) -r 'echo php_ini_loaded_file();'`; \
118 if test "$$INI_FILE"; then \
119 $(EGREP) -v '^extension[\t\ ]*=' "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
121 echo > $(top_builddir)/tmp-php.ini; \
123 TEST_PHP_EXECUTABLE=$(top_builddir)/$(SAPI_CLI_PATH) \
124 TEST_PHP_SRCDIR=$(top_srcdir) \
126 $(top_builddir)/$(SAPI_CLI_PATH) $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -c $(top_builddir)/tmp-php.ini -N -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
128 echo "ERROR: Cannot run tests without CLI sapi."; \
132 find . -name \*.gcno -o -name \*.gcda | xargs rm -f
133 find . -name \*.lo -o -name \*.o | xargs rm -f
134 find . -name \*.la -o -name \*.a | xargs rm -f
135 find . -name \*.so | xargs rm -f
136 find . -name .libs -a -type d|xargs rm -rf
137 rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
140 rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp
141 $(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f
142 find . -name Makefile | xargs rm -f
144 .PHONY: all clean install distclean test