1 # libguestfs PHP bindings
2 # Copyright (C) 2010 Red Hat Inc.
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.
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.
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.
18 include $(top_srcdir)/subdir-rules.mk
21 extension/php_guestfs_php.h \
22 extension/guestfs_php.c
27 extension/guestfs_php_*.phpt \
34 phpdir = $(sysconfdir)/php.d
35 php_DATA = guestfs_php.ini
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" \
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 -- $@
50 TESTS = run-php-tests.sh
52 # Amazingly the PHP-installed extension Makefile doesn't have a
55 # $(MAKE) -C extension clean
58 $(MAKE) -C extension INSTALL_ROOT=$(DESTDIR) install