]> sigrok.org Git - libsigrok.git/blame_incremental - Makefile.am
python: Give all enum values __doc__ strings.
[libsigrok.git] / Makefile.am
... / ...
CommitLineData
1##
2## This file is part of the libsigrok project.
3##
4## Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
5## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
6##
7## This program is free software: you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation, either version 3 of the License, or
10## (at your option) any later version.
11##
12## This program is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15## GNU General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with this program. If not, see <http://www.gnu.org/licenses/>.
19##
20
21ACLOCAL_AMFLAGS = -I m4
22AM_LIBTOOLFLAGS = --silent
23GNUMAKEFLAGS = --no-print-directory
24
25FIRMWARE_DIR = $(datadir)/sigrok-firmware
26
27local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I.
28if BINDINGS_CXX
29local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
30endif
31# Do not hard-code the firmware location on Windows.
32if WIN32
33global_defs =
34else
35global_defs = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
36endif
37# Ensure that local include directories are always searched first.
38AM_CPPFLAGS = $(local_includes) $(global_defs)
39
40# The tests CFLAGS are a superset of the libsigrok CFLAGS, and the
41# python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
42AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(TESTS_CFLAGS)
43AM_CXXFLAGS = $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)
44
45lib_LTLIBRARIES = libsigrok.la
46
47# Backend files
48libsigrok_la_SOURCES = \
49 src/backend.c \
50 src/device.c \
51 src/session.c \
52 src/session_file.c \
53 src/session_driver.c \
54 src/drivers.c \
55 src/hwdriver.c \
56 src/trigger.c \
57 src/soft-trigger.c \
58 src/analog.c \
59 src/fallback.c \
60 src/resource.c \
61 src/strutil.c \
62 src/log.c \
63 src/version.c \
64 src/error.c \
65 src/std.c
66
67# Input modules
68libsigrok_la_SOURCES += \
69 src/input/input.c \
70 src/input/binary.c \
71 src/input/chronovu_la8.c \
72 src/input/csv.c \
73 src/input/vcd.c \
74 src/input/wav.c
75
76# Output modules
77libsigrok_la_SOURCES += \
78 src/output/output.c \
79 src/output/analog.c \
80 src/output/ascii.c \
81 src/output/bits.c \
82 src/output/binary.c \
83 src/output/csv.c \
84 src/output/chronovu_la8.c \
85 src/output/wav.c \
86 src/output/gnuplot.c \
87 src/output/hex.c \
88 src/output/ols.c \
89 src/output/srzip.c \
90 src/output/vcd.c
91
92# Transform modules
93libsigrok_la_SOURCES += \
94 src/transform/transform.c \
95 src/transform/nop.c \
96 src/transform/scale.c \
97 src/transform/invert.c
98
99# SCPI support
100libsigrok_la_SOURCES += \
101 src/scpi/scpi.c \
102 src/scpi/helpers.c \
103 src/scpi/scpi_tcp.c
104if NEED_RPC
105libsigrok_la_SOURCES += \
106 src/scpi/scpi_vxi.c \
107 src/scpi/vxi_clnt.c \
108 src/scpi/vxi_xdr.c \
109 src/scpi/vxi.h
110endif
111if NEED_SERIAL
112libsigrok_la_SOURCES += \
113 src/serial.c \
114 src/scpi/scpi_serial.c
115endif
116if NEED_USB
117libsigrok_la_SOURCES += \
118 src/ezusb.c \
119 src/usb.c \
120 src/scpi/scpi_usbtmc_libusb.c
121endif
122if NEED_VISA
123libsigrok_la_SOURCES += \
124 src/scpi/scpi_visa.c
125endif
126if NEED_GPIB
127libsigrok_la_SOURCES += \
128 src/scpi/scpi_libgpib.c
129endif
130
131# Modbus support
132libsigrok_la_SOURCES += \
133 src/modbus/modbus.c
134if NEED_SERIAL
135libsigrok_la_SOURCES += \
136 src/modbus/modbus_serial_rtu.c
137endif
138
139# Hardware (DMM chip parsers)
140libsigrok_la_SOURCES += \
141 src/dmm/es519xx.c \
142 src/dmm/fs9721.c \
143 src/dmm/fs9922.c \
144 src/dmm/m2110.c \
145 src/dmm/metex14.c \
146 src/dmm/rs9lcd.c \
147 src/dmm/bm25x.c \
148 src/dmm/ut71x.c \
149 src/dmm/ut372.c \
150 src/dmm/vc870.c
151
152# Hardware (LCR chip parsers)
153if NEED_SERIAL
154libsigrok_la_SOURCES += \
155 src/lcr/es51919.c
156endif
157
158# Hardware (Scale protocol parsers)
159libsigrok_la_SOURCES += \
160 src/scale/kern.c
161
162# Hardware drivers
163if HW_AGILENT_DMM
164libsigrok_la_SOURCES += \
165 src/hardware/agilent-dmm/api.c \
166 src/hardware/agilent-dmm/agilent-dmm.h \
167 src/hardware/agilent-dmm/sched.c
168endif
169if HW_APPA_55II
170libsigrok_la_SOURCES += \
171 src/hardware/appa-55ii/protocol.h \
172 src/hardware/appa-55ii/protocol.c \
173 src/hardware/appa-55ii/api.c
174endif
175if HW_ASIX_SIGMA
176libsigrok_la_SOURCES += \
177 src/hardware/asix-sigma/asix-sigma.h \
178 src/hardware/asix-sigma/asix-sigma.c
179endif
180if HW_ATTEN_PPS3XXX
181libsigrok_la_SOURCES += \
182 src/hardware/atten-pps3xxx/protocol.h \
183 src/hardware/atten-pps3xxx/protocol.c \
184 src/hardware/atten-pps3xxx/api.c
185endif
186if HW_BAYLIBRE_ACME
187libsigrok_la_SOURCES += \
188 src/hardware/baylibre-acme/protocol.h \
189 src/hardware/baylibre-acme/protocol.c \
190 src/hardware/baylibre-acme/api.c \
191 src/hardware/baylibre-acme/gpio.h \
192 src/hardware/baylibre-acme/gpio.c
193endif
194if HW_BEAGLELOGIC
195libsigrok_la_SOURCES += \
196 src/hardware/beaglelogic/beaglelogic.h \
197 src/hardware/beaglelogic/protocol.h \
198 src/hardware/beaglelogic/protocol.c \
199 src/hardware/beaglelogic/api.c
200endif
201if HW_BRYMEN_BM86X
202libsigrok_la_SOURCES += \
203 src/hardware/brymen-bm86x/protocol.h \
204 src/hardware/brymen-bm86x/protocol.c \
205 src/hardware/brymen-bm86x/api.c
206endif
207if HW_BRYMEN_DMM
208libsigrok_la_SOURCES += \
209 src/hardware/brymen-dmm/parser.c \
210 src/hardware/brymen-dmm/protocol.h \
211 src/hardware/brymen-dmm/protocol.c \
212 src/hardware/brymen-dmm/api.c
213endif
214if HW_CEM_DT_885X
215libsigrok_la_SOURCES += \
216 src/hardware/cem-dt-885x/protocol.h \
217 src/hardware/cem-dt-885x/protocol.c \
218 src/hardware/cem-dt-885x/api.c
219endif
220if HW_CENTER_3XX
221libsigrok_la_SOURCES += \
222 src/hardware/center-3xx/protocol.h \
223 src/hardware/center-3xx/protocol.c \
224 src/hardware/center-3xx/api.c
225endif
226if HW_CHRONOVU_LA
227libsigrok_la_SOURCES += \
228 src/hardware/chronovu-la/protocol.h \
229 src/hardware/chronovu-la/protocol.c \
230 src/hardware/chronovu-la/api.c
231endif
232if HW_COLEAD_SLM
233libsigrok_la_SOURCES += \
234 src/hardware/colead-slm/protocol.h \
235 src/hardware/colead-slm/protocol.c \
236 src/hardware/colead-slm/api.c
237endif
238if HW_CONRAD_DIGI_35_CPU
239libsigrok_la_SOURCES += \
240 src/hardware/conrad-digi-35-cpu/protocol.h \
241 src/hardware/conrad-digi-35-cpu/protocol.c \
242 src/hardware/conrad-digi-35-cpu/api.c
243endif
244if HW_DEMO
245libsigrok_la_SOURCES += \
246 src/hardware/demo/demo.c
247endif
248if HW_DEREE_DE5000
249libsigrok_la_SOURCES += \
250 src/hardware/deree-de5000/api.c
251endif
252if HW_FLUKE_DMM
253libsigrok_la_SOURCES += \
254 src/hardware/fluke-dmm/fluke-dmm.h \
255 src/hardware/fluke-dmm/fluke.c \
256 src/hardware/fluke-dmm/api.c
257endif
258if HW_FX2LAFW
259libsigrok_la_SOURCES += \
260 src/hardware/fx2lafw/protocol.h \
261 src/hardware/fx2lafw/protocol.c \
262 src/hardware/fx2lafw/api.c \
263 src/hardware/fx2lafw/dslogic.c \
264 src/hardware/fx2lafw/dslogic.h
265endif
266if HW_GMC_MH_1X_2X
267libsigrok_la_SOURCES += \
268 src/hardware/gmc-mh-1x-2x/protocol.h \
269 src/hardware/gmc-mh-1x-2x/protocol.c \
270 src/hardware/gmc-mh-1x-2x/api.c
271endif
272if HW_GWINSTEK_GDS_800
273libsigrok_la_SOURCES += \
274 src/hardware/gwinstek-gds-800/protocol.h \
275 src/hardware/gwinstek-gds-800/protocol.c \
276 src/hardware/gwinstek-gds-800/api.c
277endif
278if HW_HAMEG_HMO
279libsigrok_la_SOURCES += \
280 src/hardware/hameg-hmo/protocol.h \
281 src/hardware/hameg-hmo/protocol.c \
282 src/hardware/hameg-hmo/api.c
283endif
284if HW_HANTEK_DSO
285libsigrok_la_SOURCES += \
286 src/hardware/hantek-dso/dso.h \
287 src/hardware/hantek-dso/dso.c \
288 src/hardware/hantek-dso/api.c
289endif
290if HW_HUNG_CHANG_DSO_2100
291libsigrok_la_SOURCES += \
292 src/hardware/hung-chang-dso-2100/protocol.h \
293 src/hardware/hung-chang-dso-2100/protocol.c \
294 src/hardware/hung-chang-dso-2100/api.c
295endif
296if HW_IKALOGIC_SCANALOGIC2
297libsigrok_la_SOURCES += \
298 src/hardware/ikalogic-scanalogic2/protocol.h \
299 src/hardware/ikalogic-scanalogic2/protocol.c \
300 src/hardware/ikalogic-scanalogic2/api.c
301endif
302if HW_IKALOGIC_SCANAPLUS
303libsigrok_la_SOURCES += \
304 src/hardware/ikalogic-scanaplus/protocol.h \
305 src/hardware/ikalogic-scanaplus/protocol.c \
306 src/hardware/ikalogic-scanaplus/api.c
307endif
308if HW_KECHENG_KC_330B
309libsigrok_la_SOURCES += \
310 src/hardware/kecheng-kc-330b/protocol.h \
311 src/hardware/kecheng-kc-330b/protocol.c \
312 src/hardware/kecheng-kc-330b/api.c
313endif
314if HW_KERN_SCALE
315libsigrok_la_SOURCES += \
316 src/hardware/kern-scale/protocol.h \
317 src/hardware/kern-scale/protocol.c \
318 src/hardware/kern-scale/api.c
319endif
320if HW_KORAD_KDXXXXP
321libsigrok_la_SOURCES += \
322 src/hardware/korad-kdxxxxp/protocol.h \
323 src/hardware/korad-kdxxxxp/protocol.c \
324 src/hardware/korad-kdxxxxp/api.c
325endif
326if HW_LASCAR_EL_USB
327libsigrok_la_SOURCES += \
328 src/hardware/lascar-el-usb/protocol.h \
329 src/hardware/lascar-el-usb/protocol.c \
330 src/hardware/lascar-el-usb/api.c
331endif
332if HW_MANSON_HCS_3XXX
333libsigrok_la_SOURCES += \
334 src/hardware/manson-hcs-3xxx/protocol.h \
335 src/hardware/manson-hcs-3xxx/protocol.c \
336 src/hardware/manson-hcs-3xxx/api.c
337endif
338if HW_MAYNUO_M97
339libsigrok_la_SOURCES += \
340 src/hardware/maynuo-m97/protocol.h \
341 src/hardware/maynuo-m97/protocol.c \
342 src/hardware/maynuo-m97/api.c
343endif
344if HW_MIC_985XX
345libsigrok_la_SOURCES += \
346 src/hardware/mic-985xx/protocol.h \
347 src/hardware/mic-985xx/protocol.c \
348 src/hardware/mic-985xx/api.c
349endif
350if HW_MOTECH_LPS_30X
351libsigrok_la_SOURCES += \
352 src/hardware/motech-lps-30x/protocol.h \
353 src/hardware/motech-lps-30x/protocol.c \
354 src/hardware/motech-lps-30x/api.c
355endif
356if HW_NORMA_DMM
357libsigrok_la_SOURCES += \
358 src/hardware/norma-dmm/protocol.h \
359 src/hardware/norma-dmm/protocol.c \
360 src/hardware/norma-dmm/api.c
361endif
362if HW_OPENBENCH_LOGIC_SNIFFER
363libsigrok_la_SOURCES += \
364 src/hardware/openbench-logic-sniffer/protocol.h \
365 src/hardware/openbench-logic-sniffer/protocol.c \
366 src/hardware/openbench-logic-sniffer/api.c
367endif
368if HW_PIPISTRELLO_OLS
369libsigrok_la_SOURCES += \
370 src/hardware/pipistrello-ols/protocol.h \
371 src/hardware/pipistrello-ols/protocol.c \
372 src/hardware/pipistrello-ols/api.c
373endif
374if HW_RIGOL_DS
375libsigrok_la_SOURCES += \
376 src/hardware/rigol-ds/protocol.h \
377 src/hardware/rigol-ds/protocol.c \
378 src/hardware/rigol-ds/api.c
379endif
380if HW_SALEAE_LOGIC16
381libsigrok_la_SOURCES += \
382 src/hardware/saleae-logic16/protocol.h \
383 src/hardware/saleae-logic16/protocol.c \
384 src/hardware/saleae-logic16/api.c
385endif
386if HW_SCPI_PPS
387libsigrok_la_SOURCES += \
388 src/hardware/scpi-pps/protocol.h \
389 src/hardware/scpi-pps/protocol.c \
390 src/hardware/scpi-pps/profiles.c \
391 src/hardware/scpi-pps/api.c
392endif
393if HW_SERIAL_DMM
394libsigrok_la_SOURCES += \
395 src/hardware/serial-dmm/protocol.h \
396 src/hardware/serial-dmm/protocol.c \
397 src/hardware/serial-dmm/api.c
398endif
399if HW_SYSCLK_LWLA
400libsigrok_la_SOURCES += \
401 src/hardware/sysclk-lwla/lwla.h \
402 src/hardware/sysclk-lwla/lwla.c \
403 src/hardware/sysclk-lwla/protocol.h \
404 src/hardware/sysclk-lwla/protocol.c \
405 src/hardware/sysclk-lwla/api.c
406endif
407if HW_TELEINFO
408libsigrok_la_SOURCES += \
409 src/hardware/teleinfo/protocol.h \
410 src/hardware/teleinfo/protocol.c \
411 src/hardware/teleinfo/api.c
412endif
413if HW_TESTO
414libsigrok_la_SOURCES += \
415 src/hardware/testo/protocol.h \
416 src/hardware/testo/protocol.c \
417 src/hardware/testo/api.c
418endif
419if HW_TONDAJ_SL_814
420libsigrok_la_SOURCES += \
421 src/hardware/tondaj-sl-814/protocol.h \
422 src/hardware/tondaj-sl-814/protocol.c \
423 src/hardware/tondaj-sl-814/api.c
424endif
425if HW_UNI_T_DMM
426libsigrok_la_SOURCES += \
427 src/hardware/uni-t-dmm/protocol.h \
428 src/hardware/uni-t-dmm/protocol.c \
429 src/hardware/uni-t-dmm/api.c
430endif
431if HW_UNI_T_UT32X
432libsigrok_la_SOURCES += \
433 src/hardware/uni-t-ut32x/protocol.h \
434 src/hardware/uni-t-ut32x/protocol.c \
435 src/hardware/uni-t-ut32x/api.c
436endif
437if HW_VICTOR_DMM
438libsigrok_la_SOURCES += \
439 src/hardware/victor-dmm/protocol.h \
440 src/hardware/victor-dmm/protocol.c \
441 src/hardware/victor-dmm/api.c
442endif
443if HW_YOKOGAWA_DLM
444libsigrok_la_SOURCES += \
445 src/hardware/yokogawa-dlm/protocol.h \
446 src/hardware/yokogawa-dlm/protocol.c \
447 src/hardware/yokogawa-dlm/protocol_wrappers.h \
448 src/hardware/yokogawa-dlm/protocol_wrappers.c \
449 src/hardware/yokogawa-dlm/api.c
450endif
451if HW_ZEROPLUS_LOGIC_CUBE
452libsigrok_la_SOURCES += \
453 src/hardware/zeroplus-logic-cube/analyzer.c \
454 src/hardware/zeroplus-logic-cube/analyzer.h \
455 src/hardware/zeroplus-logic-cube/gl_usb.h \
456 src/hardware/zeroplus-logic-cube/gl_usb.c \
457 src/hardware/zeroplus-logic-cube/protocol.h \
458 src/hardware/zeroplus-logic-cube/protocol.c \
459 src/hardware/zeroplus-logic-cube/api.c
460endif
461
462libsigrok_la_LIBADD = $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
463libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
464
465library_includedir = $(includedir)/libsigrok
466library_include_HEADERS = \
467 include/libsigrok/libsigrok.h \
468 include/libsigrok/proto.h
469nodist_library_include_HEADERS = \
470 include/libsigrok/version.h
471noinst_HEADERS = src/libsigrok-internal.h
472
473pkgconfigdir = $(libdir)/pkgconfig
474pkgconfig_DATA = libsigrok.pc
475
476EXTRA_DIST = \
477 Doxyfile \
478 HACKING \
479 README.devices \
480 bindings/cxx/ConfigKey_methods.cpp \
481 bindings/cxx/ConfigKey_methods.hpp \
482 bindings/cxx/ConfigKey_methods.i \
483 bindings/cxx/Doxyfile \
484 bindings/cxx/QuantityFlag_methods.cpp \
485 bindings/cxx/QuantityFlag_methods.hpp \
486 bindings/cxx/enums.py \
487 bindings/python/Doxyfile \
488 bindings/python/setup.py \
489 bindings/python/sigrok/__init__.py \
490 bindings/python/sigrok/core/__init__.py \
491 bindings/python/sigrok/core/classes.i \
492 bindings/java/Doxyfile \
493 bindings/java/org/sigrok/core/classes/classes.i \
494 bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
495 bindings/java/org/sigrok/core/interfaces/LogCallback.java \
496 bindings/swig/classes.i \
497 bindings/swig/doc.py \
498 contrib/gnuplot_chronovu_la8.gpi \
499 contrib/gnuplot_rigol_ds1xx2.gpi \
500 contrib/gnuplot_usbeesx.gpi \
501 contrib/gnuplot_usbeedx8.gpi \
502 contrib/gnuplot_usbeedx16.gpi \
503 contrib/sigrok-logo-notext.png \
504 contrib/z60_libsigrok.rules
505
506if HAVE_CHECK
507TESTS = tests/main
508check_PROGRAMS = ${TESTS}
509endif
510
511tests_main_SOURCES = \
512 include/libsigrok/libsigrok.h \
513 tests/lib.c \
514 tests/lib.h \
515 tests/main.c \
516 tests/core.c \
517 tests/input_all.c \
518 tests/input_binary.c \
519 tests/output_all.c \
520 tests/transform_all.c \
521 tests/session.c \
522 tests/strutil.c \
523 tests/version.c \
524 tests/driver_all.c \
525 tests/device.c \
526 tests/trigger.c \
527 tests/analog.c
528
529tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
530
531BUILD_EXTRA =
532INSTALL_EXTRA =
533CLEAN_EXTRA =
534
535if BINDINGS_CXX
536
537lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
538
539bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
540
541bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
542bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
543
544bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
545bindings_cxx_libsigrokcxx_la_include_HEADERS = \
546 bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
547nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
548 bindings/cxx/include/libsigrokcxx/enums.hpp
549
550pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
551
552doxy/xml/index.xml: include/libsigrok/libsigrok.h
553 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
554
555bindings/swig/enums.i: bindings/cxx/enums.timestamp
556bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
557bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
558
559bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
560 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
561 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
562 $(AM_V_at)touch $@
563
564bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
565 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
566
567cxx-clean:
568 rm -rf doxy/
569 rm -rf bindings/cxx/doxy/
570 rm -f bindings/cxx/enums.cpp
571 rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
572 rm -f bindings/cxx/enums.timestamp
573
574CLEAN_EXTRA += cxx-clean
575
576endif
577
578CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
579
580$(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
581 bindings/cxx/enums.timestamp
582 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
583
584if BINDINGS_PYTHON
585
586PDIR = bindings/python
587PDOC_START = bindings/python/sigrok/core/doc_start.i
588PDOC_END = bindings/python/sigrok/core/doc_end.i
589
590setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(AM_CXXFLAGS) $(CXXFLAGS)' LDADD='$(PYSIGROK_LIBS)'
591setup_quiet = --quiet
592setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
593
594$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
595 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
596 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
597
598$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
599 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
600 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
601
602python-build: $(PDIR)/timestamp
603
604$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
605 bindings/swig/classes.i bindings/swig/enums.i $(PDOC_START) \
606 $(PDOC_END) $(library_include_HEADERS) \
607 $(nodist_library_include_HEADERS) \
608 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
609 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
610 @ORDER@ bindings/cxx/libsigrokcxx.la
611 $(AM_V_at)$(setup_py) clean --all 2>/dev/null
612 $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" build_py
613 $(AM_V_at): >$@
614
615python-install:
616 $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
617 destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
618 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
619
620python-clean:
621 -$(AM_V_at)rm -f $(PDIR)/timestamp
622 -$(AM_V_at)rm -fr $(PDIR)/doxy
623 -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
624
625python-doc:
626 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
627
628BUILD_EXTRA += python-build
629INSTALL_EXTRA += python-install
630CLEAN_EXTRA += python-clean
631
632endif
633
634if BINDINGS_JAVA
635
636JDIR = bindings/java
637JPKG = org/sigrok/core
638JCLS = $(JDIR)/$(JPKG)/classes
639JINT = $(JDIR)/$(JPKG)/interfaces
640JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
641JSWG = $(JCLS)/classes.i
642JDOC = $(JCLS)/doc.i
643JCXX = $(JCLS)/classes_wrap.cxx
644JLIB = $(JDIR)/libsigrok_java_core_classes.so
645JJAR = $(JDIR)/sigrok-core.jar
646
647java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
648
649java-build: $(JJAR) $(JLIB)
650
651$(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
652 $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
653 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
654
655$(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i bindings/swig/enums.i \
656 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
657 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
658 -$(AM_V_at)rm -f $(java_cleanfiles)
659 $(AM_V_GEN)$(SWIG) -c++ -Dnoexcept= -Dprivate=protected \
660 -java -package org.sigrok.core.classes \
661 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
662 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
663
664$(JJAR): $(JCXX)
665 $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
666 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
667
668$(JLIB): $(JCXX) \
669 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
670 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
671 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
672 @ORDER@ bindings/cxx/libsigrokcxx.la
673 $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
674 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
675 -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
676
677java-install:
678 $(INSTALL) -d $(DESTDIR)$(libdir)/jni
679 $(INSTALL) $(JLIB) -t $(DESTDIR)$(libdir)/jni
680 $(INSTALL) -d $(DESTDIR)$(datadir)/java
681 $(INSTALL) $(JJAR) -t $(DESTDIR)$(datadir)/java
682
683java-clean:
684 -$(AM_V_at)rm -f $(java_cleanfiles)
685 -$(AM_V_at)rm -fr $(JDIR)/doxy
686
687java-doc:
688 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
689
690BUILD_EXTRA += java-build
691INSTALL_EXTRA += java-install
692CLEAN_EXTRA += java-clean
693
694endif
695
696all-local: $(BUILD_EXTRA)
697install-exec-local: $(INSTALL_EXTRA)
698clean-local: $(CLEAN_EXTRA)
699
700MAINTAINERCLEANFILES = ChangeLog
701
702.PHONY: ChangeLog
703ChangeLog:
704 git --git-dir '$(top_srcdir)/.git' log >$@ || touch $@
705
706dist-hook: ChangeLog
707