Check space around '?', after ':', not before ','
[xapian.git] / xapian-bindings / php / Makefile.am
blobb323a3cd3914c044b3233ad2c2b9581433a19ab0
1 ## Process this file with automake to produce Makefile.in
3 include ../generic/generic.mk
5 abs_builddir = @abs_builddir@
7 ## Test programs to be run
8 TESTS = smoketest.php
9 LOG_COMPILER = $(PHP)
10 # Use -n to disable use of the system php.ini (which might prevent php from
11 # using dl() which would make our test fail).  It would be nicer to use "-c"
12 # and provide an alternative php.ini but with "-c" it seems PHP still loads the
13 # system.ini first (at least with PHP 4.3.10).
14 AM_LOG_FLAGS = -n -d safe_mode=off -d enable_dl=on \
15         -d extension_dir='$(abs_builddir)/.libs' \
16         -d include_path='php5$(PHP_PATH_SEPARATOR)$(srcdir)/php5'
18 installcheck-local:
19         $(MAKE) check AM_LOG_FLAGS=
21 SWIG_GENERATED =\
22         php5/xapian_wrap.cc\
23         php5/xapian_wrap.h\
24         php5/php_xapian.h\
25         php5/xapian.php
27 EXTRA_DIST = php.i except.i \
28         generate-php-exceptions \
29         add-php-ref-handling \
30         add-php-type-hints \
31         docs/index.rst \
32         $(TESTS) $(SWIG_GENERATED)
34 BUILT_SOURCES = $(SWIG_GENERATED)
36 phpextdir = $(PHP_EXTENSION_DIR)
38 phpext_LTLIBRARIES = xapian.la
40 # This location is correct for Debian, but in general there doesn't seem
41 # to be a suitable location which is guaranteed to be in the include_path
42 # by default.
43 phpincdir = $(datadir)/php$(PHP_MAJOR_VERSION)
44 phpinc_DATA = php5/xapian.php
46 # Remove the .la file - xapian.la is never linked against (it's a module)
47 # and PHP doesn't use libltdl.  Note that the library gets installed by
48 # install-data, so that's where we need to hook.
49 install-data-hook:
50         rm -f $(DESTDIR)$(phpextdir)/xapian.la
52 # Because we don't install the .la file, "make uninstall" doesn't work and
53 # we need to remove the file ourselves.
54 uninstall-local:
55         eval `grep '^dlname=' $(phpext_LTLIBRARIES)` ; \
56           rm -f $(DESTDIR)$(phpextdir)/"$$dlname"
58 AM_CPPFLAGS = $(PHP_INC)
59 AM_CXXFLAGS = $(SWIG_CXXFLAGS) $(XAPIAN_CXXFLAGS)
60 xapian_la_LDFLAGS = -avoid-version -module $(NO_UNDEFINED)
61 xapian_la_SOURCES = php5/xapian_wrap.cc php5/xapian_wrap.h
62 xapian_la_LIBADD = $(XAPIAN_LIBS) $(PHP_LIBS)
64 if MAINTAINER_MODE
65 BUILT_SOURCES += except.i
66 except.i: $(srcdir)/generate-php-exceptions ../../xapian-core/exception_data.pm
67         $(PERL) -w -I$(srcdir)/../../xapian-core $(srcdir)/generate-php-exceptions
69 # We need to explicitly set -outdir because on Windows, SWIG splits paths at
70 # "\" when extracting the output directory from the value passed to the -o
71 # option.
73 stamp = php5/xapian_wrap.stamp
74 RUN_SWIG = stamp='$(stamp)' $(PERL) '$(top_srcdir)'/swig-depcomp $(SWIG)
76 php5/xapian_wrap.cc php5/xapian_wrap.h php5/php_xapian.h php5/xapian.php: $(stamp)
77         $(make_many_locked)
78 $(stamp): except.i add-php-ref-handling add-php-type-hints
79         $(MKDIR_P) php5
80         $(multitarget_begin)
81         $(RUN_SWIG) $(SWIG_WERROR) -I'$(srcdir)' $(SWIG_FLAGS) -c++ \
82             -php5 -prefix Xapian -outdir php5 \
83             -o php5/xapian_wrap.cc '$(srcdir)/'php.i
84         $(PERL) '$(srcdir)/'add-php-ref-handling php5/xapian.php | \
85             $(PERL) '$(srcdir)/'add-php-type-hints > php5/xapian.tmp
86         mv php5/xapian.tmp php5/xapian.php
87         $(multitarget_end)
89 -include php5/xapian_wrap.d
91 CLEANFILES = $(stamp)
92 endif
93 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
95 exampledatadir = $(docdir)/php/examples
96 dist_exampledata_DATA =\
97         docs/examples/simplesearch.php5\
98         docs/examples/simpleindex.php5\
99         docs/examples/simpleexpand.php5\
100         docs/examples/simplematchdecider.php5
102 docdatadir = $(docdir)/php
103 dist_docdata_DATA = docs/index.html
105 if DOCUMENTATION_RULES
106 BUILT_SOURCES += docs/index.html
108 .rst.html:
109         -case "$@" in */*) d=`echo "$@"|sed 's,/[^/]*$$,,'`; $(MKDIR_P) "$$d" ;; esac
110         $(RST2HTML) --exit-status=warning $< $@
111 endif