Add the perl module tarball to the build target
[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         target=`mktemp`;\
20         echo '%Locations = (' > $$target ;\
21         printf "  SourceDir => '" >> $$target ;\
22         (cd $(top_srcdir) && echo `pwd`\', ) >> $$target ;\
23         printf "  BuildDir => '" >> $$target ;\
24         (cd $(top_builddir) && echo `pwd`\' ) >> $$target ;\
25         echo ');' >> $$target ;\
26         cp $$target $(top_builddir)/perl-module/pspp-module-config
27
28
29
30 perl-module/Makefile: perl-module/Makefile.PL perl-module/pspp-module-config
31         cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix)
32
33
34 PSPP-Perl-$(VERSION).tar.gz:
35         cd perl-module && $(RM) $@
36         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) tardist
37
38 .PHONY: module-make
39 module-make: perl-module/Makefile
40         cd perl-module && $(MAKE) $(AM_MAKEFLAGS)
41
42 perl-module/lib/pspp-vers.pl: src/libpspp/version.c Makefile
43         mkdir -p perl-module/lib
44         (cd $(top_srcdir) && echo "\$$top_srcdir='"`pwd`"';") > $@
45         $(GREP) '^\$$VERSION' $(top_builddir)/src/libpspp/version.c | $(SED) -e 's/VERSION/PSPP::VERSION/' >> $@
46
47 all-local: perl-module/lib/pspp-vers.pl
48         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
49          for f in $(module_sources); do \
50           destdir=`dirname $$f` ;\
51           mkdir -p $$destdir ;\
52           if test "$(top_srcdir)/$$f" -nt "$(top_builddir)/$$f" ; then \
53                  cp $(top_srcdir)/$$f $$destdir ; \
54           fi ; \
55          done \
56         fi
57         $(MAKE) $(AM_MAKEFLAGS) module-make PSPP-Perl-$(VERSION).tar.gz
58
59 check-local:
60         loc=`pwd` ; cd $(top_builddir)/src/.libs ; llp=`pwd` ; cd $$loc ;  \
61         LD_LIBRARY_PATH=$$llp sh -c "cd perl-module && $(MAKE) $(AM_MAKEFLAGS) test "
62
63
64 clean-local:
65         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) clean
66         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
67           $(RM) $(module_sources) ; \
68         fi
69         $(RM) perl-module/Makefile.old
70
71
72 CLEANFILES += \
73         perl-module/PSPP-Perl-$(VERSION).tar.gz \
74         perl-module/pspp-module-config \
75         perl-module/lib/pspp-vers.pl \
76         perl-module/const-c.inc \
77         perl-module/const-xs.inc 
78
79 EXTRA_DIST +=  $(module_sources)