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 @@ ...@@ -2,6 +2,8 @@
# #
SWIG_FILE = $(abs_top_srcdir)/interfaces/cdi.i SWIG_FILE = $(abs_top_srcdir)/interfaces/cdi.i
BINDINGS = BINDINGS =
CLEANFILES =
BINDING_TESTS =
INTERFACES_FILES = \ INTERFACES_FILES = \
$(abs_top_srcdir)/interfaces/ruby/test.rb \ $(abs_top_srcdir)/interfaces/ruby/test.rb \
...@@ -23,7 +25,8 @@ PYTHON_WRAPPER_FILE = $(abs_top_builddir)/interfaces/python/cdi_wrapper.cpp ...@@ -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_SHARED_LIB = $(abs_top_builddir)/interfaces/python/$(MODULE_NAME).so
PYTHON_MAKEFILE = $(abs_top_builddir)/interfaces/python/Makefile 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 = bin_PROGRAMS =
noinst_PROGRAMS = noinst_PROGRAMS =
noinst_LTLIBRARIES = noinst_LTLIBRARIES =
...@@ -48,6 +51,7 @@ mulval.nc: $(abs_top_srcdir)/interfaces/mulval.nc.gz ...@@ -48,6 +51,7 @@ mulval.nc: $(abs_top_srcdir)/interfaces/mulval.nc.gz
# #
if ENABLE_RUBY if ENABLE_RUBY
BINDINGS += ruby-binding BINDINGS += ruby-binding
BINDING_TESTS += ruby-test
# Ruby ==================================================== # Ruby ====================================================
$(RUBY_WRAPPER_FILE): $(SWIG_FILE) $(RUBY_WRAPPER_FILE): $(SWIG_FILE)
mkdir -p $(dir $@) mkdir -p $(dir $@)
...@@ -55,14 +59,14 @@ $(RUBY_WRAPPER_FILE): $(SWIG_FILE) ...@@ -55,14 +59,14 @@ $(RUBY_WRAPPER_FILE): $(SWIG_FILE)
$(RUBY_MAKEFILE): $(abs_top_srcdir)/interfaces/ruby/setup.rb $(RUBY_MAKEFILE): $(abs_top_srcdir)/interfaces/ruby/setup.rb
mkdir -p $(dir $@) 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) $(RUBY_SHARED_LIB): $(RUBY_WRAPPER_FILE) $(RUBY_MAKEFILE)
cd ruby && make cd ruby && make
ruby-binding: $(RUBY_SHARED_LIB) 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 cd ruby && ruby $(abs_top_srcdir)/interfaces/ruby/test.rb
install-ruby: $(RUBY_SHARED_LIB) install-ruby: $(RUBY_SHARED_LIB)
...@@ -71,6 +75,7 @@ endif ...@@ -71,6 +75,7 @@ endif
# ========================================================= # =========================================================
if ENABLE_PYTHON if ENABLE_PYTHON
BINDINGS += python-binding BINDINGS += python-binding
BINDING_TESTS += python-test
# Python ================================================== # Python ==================================================
$(PYTHON_WRAPPER_FILE): $(SWIG_FILE) $(PYTHON_WRAPPER_FILE): $(SWIG_FILE)
mkdir -p $(dir $@) mkdir -p $(dir $@)
...@@ -78,19 +83,21 @@ $(PYTHON_WRAPPER_FILE): $(SWIG_FILE) ...@@ -78,19 +83,21 @@ $(PYTHON_WRAPPER_FILE): $(SWIG_FILE)
$(PYTHON_SHARED_LIB): $(PYTHON_WRAPPER_FILE) $(abs_top_srcdir)/interfaces/python/setup.py $(PYTHON_SHARED_LIB): $(PYTHON_WRAPPER_FILE) $(abs_top_srcdir)/interfaces/python/setup.py
mkdir -p $(dir $@) 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) 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 $< @cd python; python $<
install-python: $(PYTHON_SHARED_LIB) mulval.nc 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 endif
# #
AM_CPPFLAGS = -I$(top_srcdir)/src AM_CPPFLAGS = -I$(top_srcdir)/src
# #
all-local: $(BINDINGS) 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