Fixed bugs that prevented to "make distcheck"
[collectd.git] / bindings / Makefile.am
1 SUBDIRS =
2
3 if BUILD_WITH_JAVA
4 SUBDIRS += java
5 endif
6
7 EXTRA_DIST = perl/Makefile.PL \
8              perl/lib/Collectd.pm \
9              perl/lib/Collectd/Unixsock.pm \
10              perl/lib/Collectd/Plugins/Monitorus.pm \
11              perl/lib/Collectd/Plugins/OpenVZ.pm
12
13 CLEANFILES = \
14         buildperl/Collectd.pm \
15         buildperl/Collectd/Plugins/OpenVZ.pm \
16         buildperl/Collectd/Unixsock.pm \
17         buildperl/Makefile.PL \
18         .perl-directory-stamp
19
20 DISTCLEANFILES = \
21         buildperl/Collectd.pm \
22         buildperl/Collectd/Plugins/OpenVZ.pm \
23         buildperl/Collectd/Unixsock.pm \
24         buildperl/Makefile.PL \
25         .perl-directory-stamp
26
27 all-local: @PERL_BINDINGS@
28
29
30 install-exec-local:
31         [ ! -f buildperl/Makefile ] || ( cd buildperl && $(MAKE) install )
32
33 # Perl 'make uninstall' does not work as well as wanted.
34 # So we do the work here.
35 uninstall-local:
36         rm -f $(DESTDIR)$(mandir)/man3/Collectd::Unixsock.3pm
37         rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd.pm
38         rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd/Plugins/OpenVZ.pm
39         rm -f $(DESTDIR)$(datarootdir)/perl5/Collectd/Unixsock.pm
40         rm -f $(DESTDIR)$(prefix)/lib64/perl5/perllocal.pod
41         rm -f $(DESTDIR)$(prefix)/lib64/perl5/auto/Collectd/.packlist
42
43 clean-local:
44         rm -rf buildperl
45
46 perl: buildperl/Makefile
47         cd buildperl && $(MAKE)
48
49 buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
50         $(top_builddir)/config.status
51         cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(prefix) @PERL_BINDINGS_OPTIONS@
52
53 buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
54
55 .perl-directory-stamp:
56         if test ! -d buildperl; then \
57           mkdir -p buildperl/Collectd/Plugins; \
58           cp $(srcdir)/perl/lib/Collectd.pm buildperl/; \
59           cp $(srcdir)/perl/Makefile.PL buildperl/; \
60           cp $(srcdir)/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \
61           cp $(srcdir)/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \
62         fi
63         touch $@
64
65 .PHONY: perl
66