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