X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2FMakefile.am;h=50cd727fc9030be20efd30f3b856c8c0baf814e7;hb=a49486bffc401f74009037b49fb7feb420c92452;hp=3ab4c871af8d94f70ff8a150a1f634a3845279fc;hpb=29b8c05db28784b74fb36e538c36f824efbf1e53;p=collectd.git diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 3ab4c871..50cd727f 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -1,29 +1,61 @@ -EXTRA_DIST = java/org/collectd/java/*.java java/org/collectd/api/*.java \ - perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL \ - perl/Collectd/Unixsock.pm +SUBDIRS = + +if BUILD_WITH_JAVA +SUBDIRS += java +endif + +EXTRA_DIST = perl/Makefile.PL \ + perl/uninstall_mod.pl \ + perl/lib/Collectd.pm \ + perl/lib/Collectd/Unixsock.pm \ + perl/lib/Collectd/Plugins/Monitorus.pm \ + perl/lib/Collectd/Plugins/OpenVZ.pm + +CLEANFILES = \ + buildperl/Collectd.pm \ + buildperl/Collectd/Plugins/OpenVZ.pm \ + buildperl/Collectd/Unixsock.pm \ + buildperl/Makefile.PL \ + .perl-directory-stamp + +DISTCLEANFILES = \ + buildperl/Collectd.pm \ + buildperl/Collectd/Plugins/OpenVZ.pm \ + buildperl/Collectd/Unixsock.pm \ + buildperl/Makefile.PL \ + .perl-directory-stamp all-local: @PERL_BINDINGS@ + install-exec-local: - [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) install ) + [ ! -f buildperl/Makefile ] || ( cd buildperl && $(MAKE) install ) + +# Perl 'make uninstall' does not work as well as wanted. +# So we do the work here. +uninstall-local: + @PERL@ -I$(DESTDIR)$(prefix) $(srcdir)/perl/uninstall_mod.pl Collectd + find $(DESTDIR)$(prefix) -name "perllocal.pod" -exec rm {} \; clean-local: - [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) realclean ) + rm -rf buildperl + +perl: buildperl/Makefile + cd buildperl && $(MAKE) -perl: perl/Makefile - cd perl && $(MAKE) +buildperl/Makefile: .perl-directory-stamp buildperl/Makefile.PL \ + $(top_builddir)/config.status + cd buildperl && @PERL@ Makefile.PL INSTALL_BASE=$(DESTDIR)$(prefix) @PERL_BINDINGS_OPTIONS@ -perl/Makefile: .perl-directory-stamp perl/Makefile.PL \ - perl/Collectd/Makefile.PL $(top_builddir)/config.status - cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@ +buildperl/Makefile.PL: .perl-directory-stamp $(top_builddir)/config.status .perl-directory-stamp: - if test ! -d perl; then \ - mkdir -p perl/Collectd; \ - cp $(srcdir)/perl/Collectd.pm perl/; \ - cp $(srcdir)/perl/Makefile.PL perl/; \ - cp $(srcdir)/perl/Collectd/Unixsock.pm perl/Collectd/; \ - cp $(srcdir)/perl/Collectd/Makefile.PL perl/Collectd/; \ + if test ! -d buildperl; then \ + mkdir -p buildperl/Collectd/Plugins; \ + cp $(srcdir)/perl/lib/Collectd.pm buildperl/; \ + cp $(srcdir)/perl/Makefile.PL buildperl/; \ + cp $(srcdir)/perl/lib/Collectd/Unixsock.pm buildperl/Collectd/; \ + cp $(srcdir)/perl/lib/Collectd/Plugins/OpenVZ.pm buildperl/Collectd/Plugins/; \ fi touch $@