-EXTRA_DIST = 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