]> sigrok.org Git - libsigrok.git/blobdiff - Makefile.am
Add C++ bindings.
[libsigrok.git] / Makefile.am
index dd6b7061938631670e27d87636d842c125a5a45a..efab334dac877aa390f68d0b0c02f52f11b7bf68 100644 (file)
@@ -31,6 +31,7 @@ libsigrok_la_SOURCES = \
        session.c \
        session_file.c \
        session_driver.c \
+       drivers.c \
        hwdriver.c \
        trigger.c \
        soft-trigger.c \
@@ -248,7 +249,7 @@ libsigrok_la_SOURCES += \
        hardware/norma-dmm/protocol.c \
        hardware/norma-dmm/api.c
 endif
-if HW_OLS
+if HW_OPENBENCH_LOGIC_SNIFFER
 libsigrok_la_SOURCES += \
        hardware/openbench-logic-sniffer/protocol.h \
        hardware/openbench-logic-sniffer/protocol.c \
@@ -286,6 +287,12 @@ libsigrok_la_SOURCES += \
        hardware/teleinfo/protocol.c \
        hardware/teleinfo/api.c
 endif
+if HW_TESTO
+libsigrok_la_SOURCES += \
+       hardware/testo/protocol.h \
+       hardware/testo/protocol.c \
+       hardware/testo/api.c
+endif
 if HW_TONDAJ_SL_814
 libsigrok_la_SOURCES += \
        hardware/tondaj-sl-814/protocol.h \
@@ -326,7 +333,10 @@ libsigrok_la_LIBADD = $(LIBOBJS)
 libsigrok_la_LDFLAGS = $(SR_LIB_LDFLAGS)
 
 library_includedir = $(includedir)/libsigrok
-library_include_HEADERS = libsigrok.h proto.h version.h
+library_include_HEADERS = \
+       include/libsigrok/libsigrok.h \
+       include/libsigrok/proto.h \
+       include/libsigrok/version.h
 noinst_HEADERS = libsigrok-internal.h
 
 pkgconfigdir = $(libdir)/pkgconfig
@@ -369,6 +379,33 @@ tests_check_main_LDADD = $(top_builddir)/libsigrok.la @check_LIBS@
 
 endif
 
+if BINDINGS_CXX
+
+lib_LTLIBRARIES += bindings/cxx/libsigrokxx.la
+
+bindings_cxx_libsigrokxx_la_SOURCES = bindings/cxx/classes.cpp
+
+bindings_cxx_libsigrokxx_la_LIBADD = -lsigrok $(glibmm_LIBS)
+
+bindings_cxx_libsigrokxx_la_LDFLAGS = $(SR_LIB_LDFLAGS)
+
+library_include_HEADERS += \
+       bindings/cxx/include/libsigrok/libsigrok.hpp \
+       bindings/cxx/include/libsigrok/enums.hpp
+
+pkgconfig_DATA += bindings/cxx/libsigrokxx.pc
+
+bindings/cxx/classes.lo: bindings/cxx/enums.cpp
+
+bindings/cxx/enums.cpp: bindings/cxx/enums.py bindings/cxx/libsigrok.xml \
+               bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
+       python $<
+
+bindings/cxx/libsigrok.xml: include/libsigrok/libsigrok.h
+       gccxml $(CFLAGS) -DGLIB_DISABLE_DEPRECATION_WARNINGS $< -fxml=$@
+
+endif
+
 MAINTAINERCLEANFILES = ChangeLog
 
 .PHONY: ChangeLog