Merge remote-tracking branch 'origin/collectd-5.2' into collectd-5.2
[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         find $(DESTDIR)$(prefix) -name "perllocal.pod" -exec rm {} \;
39
40 clean-local:
41         rm -rf buildperl
42
43 perl: buildperl/Makefile
44         cd buildperl && $(MAKE)
45
46 buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \
47         $(top_builddir)/config.status
48         cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(DESTDIR)$(prefix) @PERL_BINDINGS_OPTIONS@
49
50 buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status
51
52 .perl-directory-stamp:
53         if test ! -d buildperl; then \
54           mkdir -p buildperl/Collectd/Plugins; \
55           cp $(srcdir)/perl/lib/Collectd.pm buildperl/; \
56           cp $(srcdir)/perl/Makefile.PL buildperl/; \
57           cp $(srcdir)/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \
58           cp $(srcdir)/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \
59         fi
60         touch $@
61
62 .PHONY: perl
63