Fix make distcheck (against release 5.1.1)
[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/uninstall_mod.pl \
9              perl/lib/Collectd.pm \
10              perl/lib/Collectd/Unixsock.pm \
11              perl/lib/Collectd/Plugins/Monitorus.pm \
12              perl/lib/Collectd/Plugins/OpenVZ.pm
13
14 CLEANFILES = \
15         buildperl/Collectd.pm \
16         buildperl/Collectd/Plugins/OpenVZ.pm \
17         buildperl/Collectd/Unixsock.pm \
18         buildperl/Makefile.PL \
19         .perl-directory-stamp
20
21 DISTCLEANFILES = \
22         buildperl/Collectd.pm \
23         buildperl/Collectd/Plugins/OpenVZ.pm \
24         buildperl/Collectd/Unixsock.pm \
25         buildperl/Makefile.PL \
26         .perl-directory-stamp
27
28 all-local: @PERL_BINDINGS@
29
30
31 install-exec-local:
32         [ ! -f buildperl/Makefile ] || ( cd buildperl && $(MAKE) install )
33
34 # Perl 'make uninstall' does not work as well as wanted.
35 # So we do the work here.
36 uninstall-local:
37         @PERL@ -I$(DESTDIR)$(prefix) $(srcdir)/perl/uninstall_mod.pl Collectd
38
39 clean-local:
40         rm -rf buildperl
41
42 perl: buildperl/Makefile
43         cd buildperl && $(MAKE)
44
45 buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
46         $(top_builddir)/config.status
47         cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(DESTDIR)$(prefix) @PERL_BINDINGS_OPTIONS@
48
49 buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
50
51 .perl-directory-stamp:
52         if test ! -d buildperl; then \
53           mkdir -p buildperl/Collectd/Plugins; \
54           cp $(srcdir)/perl/lib/Collectd.pm buildperl/; \
55           cp $(srcdir)/perl/Makefile.PL buildperl/; \
56           cp $(srcdir)/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \
57           cp $(srcdir)/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \
58         fi
59         touch $@
60
61 .PHONY: perl
62