Integrated the perl module into the pspp build system.
[pspp-builds.git] / perl-module / automake.mk
1 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
2
3 # PSPP
4
5
6 module_sources = \
7  perl-module/Changes \
8  perl-module/COPYING \
9  perl-module/Examples.pod \
10  perl-module/Makefile.PL \
11  perl-module/MANIFEST \
12  perl-module/ppport.h \
13  perl-module/PSPP.xs \
14  perl-module/README \
15  perl-module/typemap \
16  perl-module/lib/PSPP.pm \
17  perl-module/t/Pspp.t
18
19
20 perl-module/pspp-module-config: Makefile
21         target=`mktemp`;\
22         echo '%Locations = (' > $$target ;\
23         printf "  SourceDir => '" >> $$target ;\
24         (cd $(top_srcdir) && echo `pwd`\', ) >> $$target ;\
25         printf "  BuildDir => '" >> $$target ;\
26         (cd $(top_builddir) && echo `pwd`\' ) >> $$target ;\
27         echo ');' >> $$target ;\
28         cp $$target $(top_builddir)/perl-module/pspp-module-config
29
30
31
32 perl-module/Makefile: perl-module/Makefile.PL perl-module/pspp-module-config
33         cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix)
34
35 module-make: perl-module/Makefile
36         cd perl-module && $(MAKE) $(AM_MAKEFLAGS)
37
38 all-local:
39         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
40          for f in $(module_sources); do \
41           destdir=`dirname $$f` ;\
42           mkdir -p $$destdir ;\
43           if test "$(top_srcdir)/$$f" -nt "$(top_builddir)/$$f" ; then \
44                  cp $(top_srcdir)/$$f $$destdir ; \
45           fi ; \
46          done \
47         fi
48         $(MAKE) $(AM_MAKEFLAGS) module-make
49
50 check-local:
51         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) test
52
53
54 clean-local:
55         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) clean
56         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
57           $(RM) $(module_sources) ; \
58         fi
59         $(RM) perl-module/Makefile.old
60
61 #install-data-local:
62 #       cd perl-module && $(MAKE) $(AM_MAKEFLAGS) doc_install
63 #
64 #install-exec-local:
65 #       cd perl-module && $(MAKE) $(AM_MAKEFLAGS) pure_install
66 #
67 #uninstall-local:
68 #       cd perl-module && $(MAKE) $(AM_MAKEFLAGS) uninstall
69 #
70
71
72 CLEANFILES += \
73         perl-module/pspp-module-config \
74         perl-module/const-c.inc \
75         perl-module/const-xs.inc 
76
77
78
79 EXTRA_DIST +=  $(module_sources)