build system: Yet another way to solve the src-dir vs. build-dir issue.
[collectd.git] / bindings / Makefile.am
1 EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL perl/Collectd/Unixsock.pm
2
3 all-local: @PERL_BINDINGS@
4
5 install-exec-local:
6         [ ! -f perl/Makefile ] || $(MAKE) -C perl install
7
8 clean-local:
9         [ ! -f perl/Makefile ] || $(MAKE) -C perl realclean
10
11 perl: perl/Makefile
12         $(MAKE) -C perl
13
14 perl/Makefile: .perl-directory-stamp perl/Makefile.PL perl/Collectd/Makefile.PL
15         cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@
16
17 .perl-directory-stamp:
18         if test ! -d perl; then \
19           mkdir -p perl/Collectd; \
20           cp $(srcdir)/perl/{Collectd.pm,Makefile.PL} perl/; \
21           cp $(srcdir)/perl/Collectd/{Unixsock.pm,Makefile.PL} perl/Collectd/; \
22         fi
23         touch $@
24
25 .PHONY: perl
26