- added makefile fragment to automatically compile and install filter modules with the extension
- 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
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