inspect: win64 regexp was dead code.
[libguestfs.git] / php / Makefile.am
1 # libguestfs PHP bindings
2 # Copyright (C) 2010 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 generator_built = \
21         extension/php_guestfs_php.h \
22         extension/guestfs_php.c
23
24 EXTRA_DIST = \
25         $(generator_built) \
26         run-php-tests.sh \
27         extension/guestfs_php_*.phpt \
28         extension/config.m4 \
29         README-PHP \
30         guestfs_php.ini
31
32 if HAVE_PHP
33
34 phpdir = $(sysconfdir)/php.d
35 php_DATA = guestfs_php.ini
36
37 # In theory: EXTRA_LIBS="-lguestfs"  In fact this doesn't work
38 # and we need to add the library to EXTRA_LDFLAGS.
39 all: extension/config.h
40         $(MAKE) -C extension \
41           EXTRA_INCLUDES="-I$(abs_srcdir)/../src" \
42           EXTRA_LDFLAGS="-L$(abs_srcdir)/../src/.libs -lguestfs" \
43           all
44
45 extension/config.h: extension/config.m4 ../config.status
46         cd extension && phpize
47         cd extension && ./configure --prefix=$(prefix) --libdir=$(libdir)
48         test -f "$@" && touch -- $@
49
50 TESTS = run-php-tests.sh
51
52 # Amazingly the PHP-installed extension Makefile doesn't have a
53 # 'make clean' rule.
54 #clean-local:
55 #       $(MAKE) -C extension clean
56
57 install-data-hook:
58         $(MAKE) -C extension INSTALL_ROOT=$(DESTDIR) install
59
60 endif