docs
[pspp] / perl-module / automake.mk
1 # PSPP - a program for statistical analysis.
2 # Copyright (C) 2017 Free Software Foundation, Inc.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 #
17 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
18
19 # PSPP
20
21 module_sources = \
22  perl-module/Changes \
23  perl-module/COPYING \
24  perl-module/Examples.pod \
25  perl-module/Makefile.PL \
26  perl-module/MANIFEST \
27  perl-module/ppport.h \
28  perl-module/PSPP.xs \
29  perl-module/README \
30  perl-module/typemap \
31  perl-module/lib/PSPP.pm \
32  perl-module/t/Pspp.t
33
34 PERL_MAKEFLAGS = $(AM_MAKEFLAGS) LD_RUN_PATH=$(pkglibdir)
35
36 perl-module/pspp-module-config: Makefile
37         $(AM_V_GEN)(echo '%Locations = (';\
38          printf "  SourceDir => '";\
39          (cd "$(top_srcdir)" && echo `pwd`\', ) ;\
40          printf "  BuildDir => '";\
41          (cd "$(top_builddir)" && echo `pwd`\' );\
42          echo ');') > "$(top_builddir)/perl-module/pspp-module-config"
43
44 perl-module/Makefile: perl-module/MakefileX
45         $(SED)  -e "/^INC/s/\([^=]\)  *-I/\1\" -I/g" -e "/^INC/s/  *-I */ -I\"/g" -e "/^INC/s/ *$$/\"/" -e "/^MYEXTLIB/s/\([^=]\) \([^=]\)/\1\\\\ \2/g" $< > $@
46
47 perl-module/MakefileX: perl-module/Makefile.PL perl-module/pspp-module-config $(module_sources)
48         $(AM_V_GEN)cd perl-module && $(PERL) Makefile.PL PREFIX=$(prefix) \
49                                                          OPTIMIZE="$(CFLAGS) $(CPPFLAGS) -Wno-error" \
50                                                          LD="`$(PERL) -e 'use Config::Perl::V;print Config::Perl::V::myconfig()->{config}{ld};'` $(LDFLAGS)"
51
52 perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz: $(module_sources) perl-module/Makefile
53         $(AM_V_at)rm -f $@
54         $(AM_V_GEN)cd perl-module && $(MAKE) $(PERL_MAKEFLAGS) tardist
55
56 PHONY += module-make
57 module-make: perl-module/Makefile
58         $(AM_V_GEN)cd perl-module && $(MAKE) $(PERL_MAKEFLAGS)
59
60 PHONY += module-copy
61 DIST_HOOKS += module-copy
62 module-copy: $(module_sources)
63         @if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
64          for f in $(module_sources); do \
65           destdir=`dirname $$f` ;\
66           mkdir -p $$destdir ;\
67           if test ! -e "$(top_builddir)/$$f" || \
68              test "$(top_srcdir)/$$f" -nt "$(top_builddir)/$$f" ; then \
69                  if $(AM_V_P); then \
70                       echo cp $(top_srcdir)/$$f $$destdir ; \
71                  else \
72                       echo "  GEN      $$destdir/$$f"; \
73                  fi; \
74                  cp $(top_srcdir)/$$f $$destdir ; \
75                  chmod u+w $$destdir/`basename $$f`; \
76           fi ; \
77          done \
78         fi
79
80 ALL_LOCAL += perl_module_tarball
81 perl_module_tarball: src/libpspp-core.la module-copy
82         $(AM_V_GEN)$(MAKE) $(PERL_MAKEFLAGS) module-make perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz
83
84 CLEAN_LOCAL += perl_module_clean
85 perl_module_clean:
86         cd perl-module && $(MAKE) $(AM_MAKEFLAGS) clean || true
87         if test x"$(top_builddir)" != x"$(top_srcdir)" ; then \
88           rm -f $(module_sources) ; \
89         fi
90         rm -f perl-module/Makefile.old perl-module/MakefileX perl-module/MakefileX.old perl-module/Makefile
91
92 CLEANFILES += \
93         perl-module/PSPP-Perl-$(VERSION_FOR_PERL).tar.gz \
94         perl-module/pspp-module-config \
95         perl-module/const-c.inc \
96         perl-module/const-xs.inc
97
98 EXTRA_DIST +=  $(module_sources)