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
10 $(LIBTOOL) -dlopen xapian.la --mode=execute $(MACOS_SIP_HACK_ENV) $(PHP)
11 # Use -n to disable use of the system php.ini to avoid custom configuration
12 # settings there which might interfere with our tests.
13 AM_LOG_FLAGS = -n -d extension_dir='$(abs_builddir)/$(_libs)' -d extension=xapian
16 $(MAKE) check AM_LOG_FLAGS=
23 EXTRA_DIST = php.i except.i \
24 generate-php-exceptions \
25 add-php-ref-handling \
27 $(TESTS) $(SWIG_GENERATED)
29 BUILT_SOURCES = $(SWIG_GENERATED)
31 phpextdir = $(PHP_EXTENSION_DIR)
33 phpext_LTLIBRARIES = xapian.la
35 # Remove the .la file - xapian.la is never linked against (it's a module)
36 # and PHP doesn't use libltdl. Note that the library gets installed by
37 # install-data, so that's where we need to hook.
39 rm -f $(DESTDIR)$(phpextdir)/xapian.la
41 # Because we don't install the .la file, "make uninstall" doesn't work and
42 # we need to remove the file ourselves.
44 rm -f $(DESTDIR)$(phpextdir)/xapian.$(PHP_SHLIB_SUFFIX)
46 AM_CPPFLAGS = $(PHP_INC)
47 AM_CXXFLAGS = $(SWIG_CXXFLAGS) $(XAPIAN_CXXFLAGS)
48 xapian_la_LDFLAGS = -avoid-version -module -shrext .$(PHP_SHLIB_SUFFIX) $(NO_UNDEFINED)
49 xapian_la_SOURCES = php/xapian_wrap.cc php/xapian_wrap.h
50 xapian_la_LIBADD = $(XAPIAN_LIBS) $(PHP_LIBS)
53 BUILT_SOURCES += except.i
54 except.i: $(srcdir)/generate-php-exceptions ../../xapian-core/exception_data.pm
55 $(PERL) -w -I$(srcdir)/../../xapian-core $(srcdir)/generate-php-exceptions
57 # We need to explicitly set -outdir because on Windows, SWIG splits paths at
58 # "\" when extracting the output directory from the value passed to the -o
61 stamp = php/xapian_wrap.stamp
62 SWIG_FLAGS += -MD -MP -MT $(stamp)
64 php/xapian_wrap.cc php/xapian_wrap.h php/php_xapian.h: $(stamp)
66 $(stamp): except.i add-php-ref-handling
69 $(SWIG) $(SWIG_WERROR) -I'$(srcdir)' $(SWIG_FLAGS) -c++ \
70 -DPACKAGE_VERSION='"$(PACKAGE_VERSION)"' \
71 -php -prefix Xapian -outdir php \
72 -o php/xapian_wrap.cc '$(srcdir)/'php.i
73 $(PERL) '$(srcdir)/'add-php-ref-handling php/xapian_wrap.cc \
75 mv php/xapian_wrap.tmp php/xapian_wrap.cc
78 -include php/xapian_wrap.d
82 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
84 exampledatadir = $(docdir)/php/examples
85 dist_exampledata_DATA =\
86 docs/examples/simplesearch.php8\
87 docs/examples/simpleindex.php8\
88 docs/examples/simpleexpand.php8\
89 docs/examples/simplematchdecider.php8
91 docdatadir = $(docdir)/php
92 dist_docdata_DATA = docs/index.html
94 if DOCUMENTATION_RULES
95 BUILT_SOURCES += docs/index.html
98 -case "$@" in */*) d=`echo "$@"|sed 's,/[^/]*$$,,'`; $(MKDIR_P) "$$d" ;; esac
99 $(RST2HTML) --exit-status=warning $< $@