]> sigrok.org Git - libsigrok.git/blobdiff - Makefile.am
build: Fix distribution of Ruby bindings
[libsigrok.git] / Makefile.am
index 134896270c110eed95751abbd6e74ac5ae1c51c9..85f880e33b22c974bfd98dce5b027d118993f628 100644 (file)
@@ -65,7 +65,8 @@ libsigrok_la_SOURCES = \
        src/log.c \
        src/version.c \
        src/error.c \
-       src/std.c
+       src/std.c \
+       src/sw_limits.c
 
 # Input modules
 libsigrok_la_SOURCES += \
@@ -529,6 +530,7 @@ EXTRA_DIST = \
        bindings/python/sigrok/__init__.py \
        bindings/python/sigrok/core/__init__.py \
        bindings/python/sigrok/core/classes.i \
+       bindings/ruby/classes.i \
        bindings/java/Doxyfile \
        bindings/java/org/sigrok/core/classes/classes.i \
        bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
@@ -687,19 +689,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)
@@ -710,15 +713,19 @@ ruby-install: $(REXT)
        $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
        $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
 
+ruby-uninstall:
+       rm -f $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)/sigrok.$(RUBY_DLEXT)
+
 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 $<
 
 BUILD_EXTRA += ruby-build
 INSTALL_EXTRA += ruby-install
+UNINSTALL_EXTRA += ruby-uninstall
 CLEAN_EXTRA += ruby-clean
 
 endif