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