]> sigrok.org Git - libsigrok.git/commitdiff
ruby: Fix out-of-tree build of the bindings.
authorAurelien Jacobs <redacted>
Thu, 12 May 2016 21:08:21 +0000 (23:08 +0200)
committerAurelien Jacobs <redacted>
Thu, 12 May 2016 21:08:21 +0000 (23:08 +0200)
This closes bug #797.

Makefile.am

index 7f0cab112a38572fa11e2ff2f9a343f963778437..5db56f9e23af2bf227953fce5d6ca996fc0cb218 100644 (file)
@@ -688,19 +688,20 @@ ROBJ = $(RWRAP:.cpp=.o)
 REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
 
 $(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
+       $(AM_V_at)test -d $(RDIR) || $(MKDIR_P) $(RDIR)
        $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
 
 $(RWRAP): $(RDIR)/classes.i $(RDOC) \
                bindings/swig/classes.i bindings/swig/templates.i \
                bindings/swig/enums.i
-       $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include $(swig_defs) -o $@ $<
+       $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include -I$(RDIR) $(local_includes) $(swig_defs) -o $@ $<
 
 $(ROBJ): $(RWRAP) \
                $(library_include_HEADERS) \
                $(nodist_library_include_HEADERS) \
                $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
                $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
-       $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include -fPIC -o $@ -c $<
+       $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include $(local_includes) -fPIC -o $@ -c $<
 
 $(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
        $(AM_V_CXXLD)$(CXX) -shared -std=c++11 -o $@ $< -lsigrokcxx -Lbindings/cxx/.libs $(RBSIGROK_LIBS)
@@ -713,7 +714,7 @@ ruby-install: $(REXT)
 
 ruby-clean:
        -$(AM_V_at)rm -fr $(RDIR)/doc
-       -$(AM_V_at)rm $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
+       -$(AM_V_at)rm -f $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
 
 ruby-doc: $(RWRAP)
        $(AM_V_at)yard doc -o $(RDIR)/doc $<