Commit 2a1079cb authored by Ralf Mueller's avatar Ralf Mueller 🎣
Browse files

fix out-of-source builds for rb+py

parent 38d6d9a8
......@@ -2,6 +2,8 @@
#
SWIG_FILE = $(abs_top_srcdir)/interfaces/cdi.i
BINDINGS =
CLEANFILES =
BINDING_TESTS =
INTERFACES_FILES = \
$(abs_top_srcdir)/interfaces/ruby/test.rb \
......@@ -23,7 +25,8 @@ PYTHON_WRAPPER_FILE = $(abs_top_builddir)/interfaces/python/cdi_wrapper.cpp
PYTHON_SHARED_LIB = $(abs_top_builddir)/interfaces/python/$(MODULE_NAME).so
PYTHON_MAKEFILE = $(abs_top_builddir)/interfaces/python/Makefile
#
CLEANFILES += $(RUBY_WRAPPER_FILE) $(RUBY_MAKEFILE) $(RUBY_SHARED_LIB) $(PYTHON_MAKEFILE) $(PYTHON_SHARED_LIB) $(PYTHON_WRAPPER_FILE)
bin_PROGRAMS =
noinst_PROGRAMS =
noinst_LTLIBRARIES =
......@@ -48,6 +51,7 @@ mulval.nc: $(abs_top_srcdir)/interfaces/mulval.nc.gz
#
if ENABLE_RUBY
BINDINGS += ruby-binding
BINDING_TESTS += ruby-test
# Ruby ====================================================
$(RUBY_WRAPPER_FILE): $(SWIG_FILE)
mkdir -p $(dir $@)
......@@ -55,14 +59,14 @@ $(RUBY_WRAPPER_FILE): $(SWIG_FILE)
$(RUBY_MAKEFILE): $(abs_top_srcdir)/interfaces/ruby/setup.rb
mkdir -p $(dir $@)
cd ruby && CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/interfaces" ruby $<
cd ruby && CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/src -I$(abs_top_srcdir)/interfaces" ruby $<
$(RUBY_SHARED_LIB): $(RUBY_WRAPPER_FILE) $(RUBY_MAKEFILE)
cd ruby && make
ruby-binding: $(RUBY_SHARED_LIB)
rubyTest: $(RUBY_SHARED_LIB) mulval.nc
ruby-test: $(RUBY_SHARED_LIB) mulval.nc
cd ruby && ruby $(abs_top_srcdir)/interfaces/ruby/test.rb
install-ruby: $(RUBY_SHARED_LIB)
......@@ -71,6 +75,7 @@ endif
# =========================================================
if ENABLE_PYTHON
BINDINGS += python-binding
BINDING_TESTS += python-test
# Python ==================================================
$(PYTHON_WRAPPER_FILE): $(SWIG_FILE)
mkdir -p $(dir $@)
......@@ -78,19 +83,21 @@ $(PYTHON_WRAPPER_FILE): $(SWIG_FILE)
$(PYTHON_SHARED_LIB): $(PYTHON_WRAPPER_FILE) $(abs_top_srcdir)/interfaces/python/setup.py
mkdir -p $(dir $@)
cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/interfaces" python $(abs_top_srcdir)/interfaces/python/setup.py build_ext --inplace
cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/src -I$(abs_top_srcdir)/interfaces" python $(abs_top_srcdir)/interfaces/python/setup.py build_ext --inplace -R "$(abs_top_builddir)/src/.libs"
python-binding: $(PYTHON_SHARED_LIB)
pythonTest: $(abs_top_srcdir)/interfaces/python/test.py mulval.nc
python-test: $(abs_top_srcdir)/interfaces/python/test.py mulval.nc
@cd python; python $<
install-python: $(PYTHON_SHARED_LIB) mulval.nc
cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/interfaces" python setup.py install --prefix=$(prefix)
cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I$(abs_top_srcdir)/src -I$(abs_top_srcdir)/interfaces" python setup.py install --prefix=$(prefix) -R $(libdir)
endif
#
AM_CPPFLAGS = -I$(top_srcdir)/src
#
all-local: $(BINDINGS)
#
CLEANFILES = `ls *~ *.o *.so */*.o */*.so`
test: $(BINDING_TESTS)
#
CLEANFILES += `ls *~ *.o *.la`
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment