use libdir instead of exec_prefix/lib ... maybe someone wants their libraries in...
[rrdtool.git] / bindings / Makefile.am
1 .PHONY: python ruby
2
3 if BUILD_TCL
4 SUB_tcl = tcl
5 endif
6
7 SUBDIRS = $(SUB_tcl)
8
9 # the following files are not mentioned in any other Makefile
10 EXTRA_DIST = perl-piped/MANIFEST perl-piped/README perl-piped/Makefile.PL perl-piped/RRDp.pm perl-piped/t/base.t \
11              perl-shared/ntmake.pl perl-shared/MANIFEST perl-shared/README perl-shared/Makefile.PL perl-shared/RRDs.pm  perl-shared/RRDs.xs perl-shared/t/base.t \
12              ruby/CHANGES     ruby/README      ruby/extconf.rb  ruby/main.c      ruby/test.rb \
13              python/ACKNOWLEDGEMENT python/AUTHORS python/COPYING python/README python/rrd_extra.h python/rrdtoolmodule.c python/setup.py
14
15
16 # add the following to the all target
17 all-local:  @COMP_PERL@ @COMP_RUBY@ @COMP_PYTHON@
18
19 install-data-local:
20         test -f perl-piped/Makefile && cd perl-piped && $(MAKE) install || true
21         test -f perl-shared/Makefile && cd perl-shared && $(MAKE) install || true
22         test -f ruby/Makefile && cd ruby && $(MAKE) EPREFIX=$(DESTDIR)$(exec_prefix) $(RUBY_MAKE_OPTIONS) install || true
23         test -d python/build && cd python && env BUILDLIBDIR=../../src/.libs $(PYTHON) setup.py install --skip-build --prefix=$(DESTDIR)$(prefix) --exec-prefix=$(DESTDIR)$(exec_prefix) || true
24
25 # rules for buildung the ruby module
26 # RUBYARCHDIR= is to work around in a makefile quirk not sure 
27 # it is is the right thing todo, but it makes rrdtool build on freebsd as well
28 ruby: 
29         cd ruby && $(RUBY) extconf.rb && $(MAKE) EPREFIX=$(exec_prefix) $(RUBY_MAKE_OPTIONS) RUBYARCHDIR=
30
31 # rules for buildung the pyton module
32 python:
33         cd python && env BUILDLIBDIR=../../src/.libs $(PYTHON) setup.py build_ext --rpath=$(libdir) && env LIBDIR=../../src/.libs $(PYTHON) setup.py build
34
35 # rules for building the perl module
36 perl_piped: perl-piped/Makefile
37         cd perl-piped && $(MAKE)
38
39 perl-piped/Makefile: perl-piped/Makefile.PL
40         cd perl-piped && $(PERL) Makefile.PL $(PERL_MAKE_OPTIONS)
41
42 perl_shared: perl-shared/Makefile
43         cd perl-shared && $(MAKE)
44
45 perl-shared/Makefile: perl-shared/Makefile.PL
46         cd perl-shared && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS) RPATH=$(libdir)
47 # LIBS="$(LDFLAGS) $(LIBS)" $(PERLFLAGS) $(PERL_MAKE_OPTIONS)
48
49 clean-local:
50         test -f perl-piped/Makefile && cd perl-piped && $(MAKE) clean || true
51         test -f perl-piped/Makefile && rm perl-piped/Makefile || true
52         test -f perl-shared/Makefile && cd perl-shared && $(MAKE) clean || true
53         test -f perl-shared/Makefile && rm -f perl-shared/Makefile || true 
54         test -f ruby/Makefile && cd ruby && $(MAKE) clean && rm Makefile || true 
55         test -d python/build && cd python &&  rm -rf build || true
56 ##END##