summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorpp <pp@455248ca-bdda-0310-9134-f4ebb693071a>2011-05-04 22:44:12 +0000
committerpp <pp@455248ca-bdda-0310-9134-f4ebb693071a>2011-05-04 22:44:12 +0000
commitfd3e80fb30194c7c5dc4e8069852559ab054b204 (patch)
treeb949e42c911fbaa52b2f9ab8a2a26b569da30a78
parentd994b724f319f04948f6ae3ec2f43723132f7df3 (diff)
- added makefile fragment to automatically compile and install filter modules with the extension
git-svn-id: https://siedziba.pl:790/svn/repos/php-imlib/trunk@337 455248ca-bdda-0310-9134-f4ebb693071a
-rw-r--r--Makefile.frag21
-rw-r--r--config.m41
2 files changed, 22 insertions, 0 deletions
diff --git a/Makefile.frag b/Makefile.frag
new file mode 100644
index 0000000..e4774f4
--- /dev/null
+++ b/Makefile.frag
@@ -0,0 +1,21 @@
+filters_srcdir := $(top_srcdir)/filters
+filters_builddir := $(top_builddir)/filters
+filters := $(notdir $(basename $(wildcard $(filters_srcdir)/*.c)))
+filters_la := $(addprefix $(filters_builddir)/,$(addsuffix .la,$(filters)))
+filters_lo := $(addprefix $(filters_builddir)/,$(addsuffix .lo,$(filters)))
+filters_libdir := $(INSTALL_ROOT)$(EXTENSION_DIR)/php_imlib_filters
+
+all : $(filters_la)
+install: filters_install
+clean: filters_clean
+
+$(filters_lo) : $(filters_builddir)/%.lo : $(filters_srcdir)/%.c
+ $(LIBTOOL) --mode=compile $(CC) -c `php-config --includes` -I$(top_srcdir) $(filters_srcdir)/$*.c -o $(filters_builddir)/$*.lo
+$(filters_la) : %.la : %.lo
+ $(LIBTOOL) --mode=link $(CC) -module -avoid-version -o $*.la $*.lo -rpath $(filters_libdir) -lm
+filters_install:
+ $(mkinstalldirs) $(filters_libdir)
+ $(LIBTOOL) --mode=install cp $(filters_la) $(filters_libdir)
+filters_clean:
+ rm -f $(filters_builddir)/*.{la,lo}
+ rm -rf $(filters_builddir)/.libs
diff --git a/config.m4 b/config.m4
index 8f4cd3c..c63340b 100644
--- a/config.m4
+++ b/config.m4
@@ -45,4 +45,5 @@ if test "$PHP_IMLIB" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(ltdl, /usr/lib, IMLIB_SHARED_LIBADD)
PHP_SUBST(IMLIB_SHARED_LIBADD)
PHP_NEW_EXTENSION(imlib, php_imlib.c, $ext_shared)
+ PHP_ADD_MAKEFILE_FRAGMENT()
fi