bindings/Makefile.am: Tie OpenVZ.pm into the build system.
[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/OpenVZ.pm
11
12 all-local: @PERL_BINDINGS@
13
14 install-exec-local:
15         [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) install )
16
17 clean-local:
18         [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) realclean )
19
20 perl: perl/Makefile
21         cd perl && $(MAKE)
22
23 perl/Makefile: .perl-directory-stamp perl/Makefile.PL \
24         $(top_builddir)/config.status
25         cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@
26
27 .perl-directory-stamp:
28         if test ! -d perl; then \
29           mkdir -p perl/Collectd/Plugins; \
30           cp $(srcdir)/perl/Collectd.pm perl/; \
31           cp $(srcdir)/perl/Makefile.PL perl/; \
32           cp $(srcdir)/perl/Collectd/Unixsock.pm perl/Collectd/; \
33           cp $(srcdir)/perl/Collectd/Plugins/OpenVZ.pm perl/Collectd/Plugins/; \
34         fi
35         touch $@
36
37 .PHONY: perl
38