$(CPPXMLDOC): bindings/cxx/include/libsigrok/libsigrok.hpp \
bindings/cxx/enums.timestamp
- $(AM_V_GEN)cd bindings/cxx && doxygen Doxyfile 2>/dev/null
+ $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
if BINDINGS_PYTHON
JPKG = org/sigrok/core
JCLS = $(JDIR)/$(JPKG)/classes
JINT = $(JDIR)/$(JPKG)/interfaces
-JSRC = $(JCLS)/*.java $(JINT)/*.java
+JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
JSWG = $(JCLS)/classes.i
JDOC = $(JCLS)/doc.i
JCXX = $(JCLS)/classes_wrap.cxx
java-build: $(JJAR) $(JLIB)
$(JDOC): bindings/swig/doc.py $(CPPXMLDOC)
- $(AM_V_GEN)python bindings/swig/doc.py java $(CPPXMLDOC) > $@
+ $(AM_V_at)test -d $(JCLS) || mkdir -p $(JCLS)
+ $(AM_V_GEN)python $< java $(CPPXMLDOC) > $@
$(JCXX): $(JSWG) $(JDOC) bindings/swig/classes.i $(library_include_HEADERS)
$(AM_V_GEN)swig -c++ -java -package org.sigrok.core.classes \
- -Iinclude -Ibindings/cxx/include -outdir $(JCLS) $(JSWG)
+ -I$(srcdir)/include -I$(srcdir)/bindings/cxx/include -I$(srcdir) -I$(JCLS) -Ibindings/cxx/include -outdir $(JCLS) -o $@ $<
$(JJAR): $(JCXX)
- $(AM_V_GEN)$(JAVAC) -sourcepath $(JDIR) $(JSRC)
+ $(AM_V_GEN)$(JAVAC) -sourcepath $(JDIR) -d $(JDIR) $(JSRC)
$(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
$(JLIB): $(JCXX) bindings/cxx/libsigrokxx.la $(library_include_HEADERS)
rm -rf $(JDIR)/doxy/
java-doc:
- $(AM_v_at)cd $(JDIR) && doxygen Doxyfile 2>/dev/null
+ $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR=$(abs_builddir)/$(JDIR)/ doxygen Doxyfile 2>/dev/null
BUILD_EXTRA += java-build
INSTALL_EXTRA += java-install
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = doxy
+OUTPUT_DIRECTORY = $(BUILDDIR)doxy
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# preprocessor.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-INCLUDE_PATH =
+INCLUDE_PATH = $(BUILDDIR)include/libsigrok
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# Get directory this script is in.
dirname = os.path.dirname(os.path.realpath(__file__))
+outdirname = "bindings/cxx"
+if not os.path.exists(os.path.join(outdirname, 'include/libsigrok')):
+ os.makedirs(os.path.join(outdirname, 'include/libsigrok'))
+
mapping = dict([
('sr_loglevel', ('LogLevel', 'Log verbosity level')),
('sr_packettype', ('PacketType', 'Type of datafeed packet')),
if name in mapping:
classes[member] = mapping[name]
-header = open(os.path.join(dirname, 'include/libsigrok/enums.hpp'), 'w')
-code = open(os.path.join(dirname, 'enums.cpp'), 'w')
+header = open(os.path.join(outdirname, 'include/libsigrok/enums.hpp'), 'w')
+code = open(os.path.join(outdirname, 'enums.cpp'), 'w')
for file in (header, code):
print >> file, "/* Generated file - edit enums.py instead! */"
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = doxy
+OUTPUT_DIRECTORY = $(BUILDDIR)doxy
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = org/sigrok/core
+INPUT = org/sigrok/core $(BUILDDIR)org/sigrok/core
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
AC_SUBST(SR_PKGLIBS)
CFLAGS="$CFLAGS -Iinclude/libsigrok -I${srcdir}/include/libsigrok $LIB_CFLAGS"
-CXXFLAGS="$CXXFLAGS -Iinclude/libsigrok -I${srcdir}/include -I${srcdir}/bindings/cxx/include $LIB_CFLAGS"
+CXXFLAGS="$CXXFLAGS -Iinclude/libsigrok -I${srcdir}/include -Ibindings/cxx -Ibindings/cxx/include/libsigrok -I${srcdir}/bindings/cxx/include $LIB_CFLAGS"
# Find Java compiler and JNI includes for Java bindings.