Debian Codegraph @

php/Makefile.am

raw
1 # -*- Mode: Makefile -*-
2 #
3 # Makefile.am - automake file for PHP interface to Redland
4 #
5 # Copyright (C) 2002-2012 David Beckett - http://www.dajobe.org/
6 # Copyright (C) 2002-2005 University of Bristol - http://www.bristol.ac.uk/
7 #
8 # This package is Free Software and part of Redland http://librdf.org/
9 #
10 # It is licensed under the following three licenses as alternatives:
11 # 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
12 # 2. GNU General Public License (GPL) V2 or any newer version
13 # 3. Apache License, V2.0 or any newer version
14 #
15 # You may not use this file except in compliance with at least one of
16 # the above three licenses.
17 #
18 # See LICENSE.html or LICENSE.txt at the top of this package for the
19 # full license terms.
20 #
21
22 AM_CPPFLAGS=@CPPFLAGS@ @LIBRDF_CPPFLAGS@ @PHP_INCLUDES@ -DREDLAND_BINDINGS_VERSION=\"@VERSION@\"
23 AM_CFLAGS=@STANDARD_CFLAGS@ @LIBRDF_CPPFLAGS@ $(MEM)
24
25 AM_LDFLAGS=@LIBRDF_LDFLAGS@ $(MEM_LIBS)
26
27 PHP=php
28
29 PHP_PACKAGE=redland
30
31 PHP_CFLAGS=@PHP_CFLAGS@
32 PHP_LDFLAGS=@PHP_LDFLAGS@
33 PHP_SO_SUFFIX=@PHP_SO_SUFFIX@
34 PHP_SWIG=@PHP_SWIG@
35
36 SWIG_OUTPUTS=$(PHP_PACKAGE)_wrap.c php_$(PHP_PACKAGE).h
37 SWIG_CRUFT=$(PHP_PACKAGE).php
38
39 phpdir=@PHP_EXTENSION_DIR@
40 php_DATA=$(PHP_PACKAGE).$(PHP_SO_SUFFIX)
41
42 EXTRA_DIST=\
43 test.php example.php php.ini \
44 redland-decl.i redland-init.i redland-post.i redland-typemap.i \
45 $(SWIG_OUTPUTS)
46
47 CLEANFILES=\
48 *.db test-out.rdf \
49 $(PHP_PACKAGE)_wrap.o $(PHP_PACKAGE)-stamp \
50 $(PHP_PACKAGE).$(PHP_SO_SUFFIX) $(PHP_PACKAGE).bundle
51
52 MAINTAINERCLEANFILES=$(SWIG_OUTPUTS) $(SWIG_CRUFT)
53
54 RUN=@REDLAND_RUN@
55
56 SWIG_OPTS=-I$(srcdir) -DREDLAND_POST_I -DREDLAND_INIT_I -DREDLAND_DECL_I -DREDLAND_TYPEMAP_I
57
58 $(PHP_PACKAGE)_wrap.c: @REDLAND_SWIG@ redland-decl.i redland-init.i redland-post.i redland-typemap.i
59 swig -v $(PHP_SWIG) $(SWIG_OPTS) -noproxy -module $(PHP_PACKAGE) -o $@ @REDLAND_SWIG@
60 rm -f $(PHP_PACKAGE).php
61
62 # -UHAVE_CONFIG_H to stop PHP trying to include config.h which
63 # quite often just doesn't exist
64 $(PHP_PACKAGE)_wrap.o: $(PHP_PACKAGE)_wrap.c
65 $(CC) $(DEFS) $(PHP_CFLAGS) $(SWIG_OPTS) -UHAVE_CONFIG_H $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(STANDARD_CFLAGS) -fPIC -DPIC $(PHP_PACKAGE)_wrap.c -c -o $@
66
67 $(PHP_PACKAGE).$(PHP_SO_SUFFIX): $(PHP_PACKAGE)-stamp
68 $(PHP_PACKAGE)-stamp: $(PHP_PACKAGE)_wrap.o
69 $(CC) $(STANDARD_CFLAGS) $(PHP_PACKAGE)_wrap.o $(AM_LDFLAGS) $(LDFLAGS) $(PHP_LDFLAGS) -o $(PHP_PACKAGE).$(PHP_SO_SUFFIX)
70 touch $(PHP_PACKAGE)-stamp
71
72 check-local: test-php
73
74 # Make PHP run using the build directory (.) as the PHP extension dir
75 # to find redland.so (see php.ini for the configuration there)
76 # -c $(srcdir) is the only portable way to make it read php.ini
77 # from here rather than (also) reading some global php.ini.
78 # The alternative to use php -n is only available in PHP 4.3.0 or newer.
79 #
80 # See the manual for the php command:
81 # http://www.php.net/manual/en/features.commandline.php
82 #
83 # 1.0.11.1: Added -d enable_dl=On because sometimes this test gives a warning"
84 test-php: $(PHP_PACKAGE).$(PHP_SO_SUFFIX) $(srcdir)/test.php
85 $(RUN)$(PHP) -d enable_dl=On -c $(srcdir) $(srcdir)/test.php