diff --git a/bindings/Makefile.am b/bindings/Makefile.am
index 5aa49435fea620fa0d32ecf6a04bf523c248ebb6..16872e88e2159dd4b3db58cc72377a93ccc4f30d 100644 (file)
--- a/bindings/Makefile.am
+++ b/bindings/Makefile.am
EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL perl/Collectd/Unixsock.pm
-PERL_SUBDIR = $(srcdir)/perl
-
all-local: @PERL_BINDINGS@
install-exec-local:
- [ ! -f $(PERL_SUBDIR)/Makefile ] || $(MAKE) -C $(PERL_SUBDIR) install
+ [ ! -f perl/Makefile ] || $(MAKE) -C perl install
clean-local:
- [ ! -f $(PERL_SUBDIR)/Makefile ] || $(MAKE) -C $(PERL_SUBDIR) realclean
+ [ ! -f perl/Makefile ] || $(MAKE) -C perl realclean
+
+perl: perl/Makefile
+ $(MAKE) -C perl
-@srcdir@/perl: $(PERL_SUBDIR)/Makefile
- $(MAKE) -C $(PERL_SUBDIR)
+perl/Makefile: .perl-directory-stamp perl/Makefile.PL perl/Collectd/Makefile.PL
+ cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@
-@srcdir@/perl/Makefile: @srcdir@/perl/Makefile.PL @srcdir@/perl/Collectd/Makefile.PL
- cd $(PERL_SUBDIR) && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@
+.perl-directory-stamp:
+ if test ! -d perl; then \
+ mkdir -p perl/Collectd; \
+ cp $(srcdir)/perl/{Collectd.pm,Makefile.PL} perl/; \
+ cp $(srcdir)/perl/Collectd/{Unixsock.pm,Makefile.PL} perl/Collectd/; \
+ fi
+ touch $@
-.PHONY: @srcdir@/perl
+.PHONY: perl