Avoid GNU make extension $(RM) in makefiles.
[pspp-builds.git] / perl-module / automake.mk
1 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
2
3 # PSPP
4
5 module_sources = \
6  perl-module/Changes \
7  perl-module/COPYING \
8  perl-module/Examples.pod \
9  perl-module/Makefile.PL \
10  perl-module/MANIFEST \
11  perl-module/ppport.h \
12  perl-module/PSPP.xs \
13  perl-module/README \
14  perl-module/typemap \
15  perl-module/lib/PSPP.pm \
16  perl-module/t/Pspp.t
17
18 perl-module/pspp-module-config: Makefile
19         (echo '%Locations = (';\
20          printf "  SourceDir => '";\
21          (cd $(top_srcdir) && echo `pwd`\', ) ;\
22          printf "  BuildDir => '";\
23          (cd $(top_builddir) && echo `pwd`\' );\
24          echo ');') > $(top_builddir)/perl-module/pspp-module-config
25
26 perl-module/Makefile: perl-module/Makefile.PL perl-module/pspp-module-config
27         cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix)
28
29 perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz: $(module_sources)
30         rm -f $@
31         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) tardist
32
33 PHONY += module-make
34 module-make: perl-module/Makefile src/libpspp-core.la
35         cd perl-module && $(MAKE) $(AM_MAKEFLAGS)
36
37 perl_module_tarball:
38         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
39          for f in $(module_sources); do \
40           destdir=`dirname $$f` ;\
41           mkdir -p $$destdir ;\
42           if test "$(top_srcdir)/$$f" -nt "$(top_builddir)/$$f" ; then \
43                  cp $(top_srcdir)/$$f $$destdir ; \
44                  echo cp $(top_srcdir)/$$f $$destdir ; \
45           fi ; \
46          done \
47         fi
48         $(MAKE) $(AM_MAKEFLAGS) module-make perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz
49
50 ALL_LOCAL += perl_module_tarball
51
52 check-local:
53         loc=`pwd` ; cd $(top_builddir)/src/.libs ; llp=`pwd` ; cd $$loc ;  \
54         LANG=C LD_LIBRARY_PATH=$$llp sh -c "cd perl-module && $(MAKE) $(AM_MAKEFLAGS) test"
55
56
57 perl_module_CLEAN:
58         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) clean || true
59         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
60           rm -f $(module_sources) ; \
61         fi
62         rm -f perl-module/Makefile.old
63
64 CLEAN_LOCAL += perl_module_CLEAN
65
66 CLEANFILES += \
67         perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz \
68         perl-module/pspp-module-config \
69         perl-module/const-c.inc \
70         perl-module/const-xs.inc 
71
72 EXTRA_DIST +=  $(module_sources)