kingst-la2016: fix segfault that often occurs when a capture is aborted
[libsigrok.git] / Makefile.am
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
21 ACLOCAL_AMFLAGS = -I m4
22 AM_LIBTOOLFLAGS = --silent
23 GNUMAKEFLAGS = --no-print-directory
24
25 # distutils/setuptools cause trouble on distcheck. Disable for now.
26 DISTCHECK_CONFIGURE_FLAGS = --disable-python
27
28 FIRMWARE_DIR = $(datadir)/sigrok-firmware
29
30 local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I. @RPC_CFLAGS@
31 if BINDINGS_CXX
32 local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
33 endif
34 # Do not hard-code the firmware location on Windows.
35 if WIN32
36 global_defs =
37 else
38 global_defs = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
39 endif
40 # Ensure that local include directories are always searched first.
41 AM_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.
45 AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(TESTS_CFLAGS)
46 AM_CXXFLAGS = $(SR_WXXFLAGS) $(LIBSIGROKCXX_CFLAGS)
47
48 lib_LTLIBRARIES = libsigrok.la
49
50 # Backend files
51 libsigrok_la_SOURCES = \
52         src/backend.c \
53         src/binary_helpers.c \
54         src/conversion.c \
55         src/crc.c \
56         src/device.c \
57         src/session.c \
58         src/session_file.c \
59         src/session_driver.c \
60         src/hwdriver.c \
61         src/trigger.c \
62         src/soft-trigger.c \
63         src/analog.c \
64         src/fallback.c \
65         src/resource.c \
66         src/strutil.c \
67         src/log.c \
68         src/version.c \
69         src/error.c \
70         src/std.c \
71         src/sw_limits.c
72
73 # Input modules
74 libsigrok_la_SOURCES += \
75         src/input/input.c \
76         src/input/feed_queue.c \
77         src/input/binary.c \
78         src/input/chronovu_la8.c \
79         src/input/csv.c \
80         src/input/logicport.c \
81         src/input/raw_analog.c \
82         src/input/saleae.c \
83         src/input/trace32_ad.c \
84         src/input/vcd.c \
85         src/input/wav.c \
86         src/input/null.c
87
88 # Output modules
89 libsigrok_la_SOURCES += \
90         src/output/output.c \
91         src/output/analog.c \
92         src/output/ascii.c \
93         src/output/bits.c \
94         src/output/binary.c \
95         src/output/csv.c \
96         src/output/chronovu_la8.c \
97         src/output/wav.c \
98         src/output/hex.c \
99         src/output/ols.c \
100         src/output/srzip.c \
101         src/output/vcd.c \
102         src/output/wavedrom.c \
103         src/output/null.c
104
105 # Transform modules
106 libsigrok_la_SOURCES += \
107         src/transform/transform.c \
108         src/transform/nop.c \
109         src/transform/scale.c \
110         src/transform/invert.c
111
112 # SCPI support
113 libsigrok_la_SOURCES += \
114         src/scpi.h \
115         src/scpi/scpi.c \
116         src/scpi/scpi_tcp.c
117 if NEED_RPC
118 libsigrok_la_SOURCES += \
119         src/scpi/scpi_vxi.c \
120         src/scpi/vxi_clnt.c \
121         src/scpi/vxi_xdr.c \
122         src/scpi/vxi.h
123 endif
124 # if HAVE_BLUETOOTH
125 libsigrok_la_SOURCES += \
126         src/bt/bt_bluez.c
127 # endif
128 if NEED_SERIAL
129 libsigrok_la_SOURCES += \
130         src/serial.c \
131         src/serial_bt.c \
132         src/serial_hid.c \
133         src/serial_hid.h \
134         src/serial_hid_bu86x.c \
135         src/serial_hid_ch9325.c \
136         src/serial_hid_cp2110.c \
137         src/serial_hid_victor.c \
138         src/serial_libsp.c \
139         src/scpi/scpi_serial.c
140 endif
141 if NEED_USB
142 libsigrok_la_SOURCES += \
143         src/ezusb.c \
144         src/usb.c \
145         src/scpi/scpi_usbtmc_libusb.c
146 endif
147 if NEED_VISA
148 libsigrok_la_SOURCES += \
149         src/scpi/scpi_visa.c
150 endif
151 if NEED_GPIB
152 libsigrok_la_SOURCES += \
153         src/scpi/scpi_libgpib.c
154 endif
155
156 # Modbus support
157 libsigrok_la_SOURCES += \
158         src/modbus/modbus.c
159 if NEED_SERIAL
160 libsigrok_la_SOURCES += \
161         src/modbus/modbus_serial_rtu.c
162 endif
163
164 # Hardware (DMM chip parsers)
165 libsigrok_la_SOURCES += \
166         src/dmm/asycii.c \
167         src/dmm/bm25x.c \
168         src/dmm/bm52x.c \
169         src/dmm/bm85x.c \
170         src/dmm/bm86x.c \
171         src/dmm/dtm0660.c \
172         src/dmm/eev121gw.c \
173         src/dmm/es519xx.c \
174         src/dmm/fs9721.c \
175         src/dmm/fs9922.c \
176         src/dmm/m2110.c \
177         src/dmm/metex14.c \
178         src/dmm/mm38xr.c \
179         src/dmm/ms2115b.c \
180         src/dmm/ms8250d.c \
181         src/dmm/rs9lcd.c \
182         src/dmm/ut372.c \
183         src/dmm/ut71x.c \
184         src/dmm/vc870.c \
185         src/dmm/vc96.c
186
187 # Hardware (LCR chip parsers)
188 if NEED_SERIAL
189 libsigrok_la_SOURCES += \
190         src/lcr/es51919.c \
191         src/lcr/vc4080.c
192 endif
193
194 # Hardware (Scale protocol parsers)
195 libsigrok_la_SOURCES += \
196         src/scale/kern.c
197
198 # Hardware drivers
199 noinst_LTLIBRARIES = src/libdrivers.la \
200         src/libdrivers_head.la src/libdrivers_tail.la
201
202 src/libdrivers.o: src/libdrivers.la \
203                 src/libdrivers_head.la src/libdrivers_tail.la
204         $(AM_V_CCLD)$(LINK) src/libdrivers_head.la src/libdrivers.la \
205                 src/libdrivers_tail.la
206 src/libdrivers.lo: src/libdrivers.o
207         $(AM_V_GEN)echo "# Generated by libtool" > $@
208         $(AM_V_at)echo "pic_object='libdrivers.o'" >> $@
209         $(AM_V_at)echo "non_pic_object='libdrivers.o'" >> $@
210
211 src_libdrivers_head_la_SOURCES = src/driver_list_start.c
212
213 src_libdrivers_tail_la_SOURCES = src/driver_list_stop.c
214
215 src_libdrivers_la_SOURCES = src/drivers.c
216
217 if HW_AGILENT_DMM
218 src_libdrivers_la_SOURCES += \
219         src/hardware/agilent-dmm/protocol.h \
220         src/hardware/agilent-dmm/protocol.c \
221         src/hardware/agilent-dmm/api.c
222 endif
223 if HW_APPA_55II
224 src_libdrivers_la_SOURCES += \
225         src/hardware/appa-55ii/protocol.h \
226         src/hardware/appa-55ii/protocol.c \
227         src/hardware/appa-55ii/api.c
228 endif
229 if HW_ARACHNID_LABS_RE_LOAD_PRO
230 src_libdrivers_la_SOURCES += \
231         src/hardware/arachnid-labs-re-load-pro/protocol.h \
232         src/hardware/arachnid-labs-re-load-pro/protocol.c \
233         src/hardware/arachnid-labs-re-load-pro/api.c
234 endif
235 if HW_ASIX_SIGMA
236 src_libdrivers_la_SOURCES += \
237         src/hardware/asix-sigma/protocol.h \
238         src/hardware/asix-sigma/protocol.c \
239         src/hardware/asix-sigma/api.c
240 endif
241 if HW_ATTEN_PPS3XXX
242 src_libdrivers_la_SOURCES += \
243         src/hardware/atten-pps3xxx/protocol.h \
244         src/hardware/atten-pps3xxx/protocol.c \
245         src/hardware/atten-pps3xxx/api.c
246 endif
247 if HW_BAYLIBRE_ACME
248 src_libdrivers_la_SOURCES += \
249         src/hardware/baylibre-acme/protocol.h \
250         src/hardware/baylibre-acme/protocol.c \
251         src/hardware/baylibre-acme/api.c \
252         src/hardware/baylibre-acme/gpio.h \
253         src/hardware/baylibre-acme/gpio.c
254 endif
255 if HW_BEAGLELOGIC
256 src_libdrivers_la_SOURCES += \
257         src/hardware/beaglelogic/beaglelogic.h \
258         src/hardware/beaglelogic/protocol.h \
259         src/hardware/beaglelogic/protocol.c \
260         src/hardware/beaglelogic/api.c \
261         src/hardware/beaglelogic/beaglelogic_native.c \
262         src/hardware/beaglelogic/beaglelogic_tcp.c
263 endif
264 if HW_CEM_DT_885X
265 src_libdrivers_la_SOURCES += \
266         src/hardware/cem-dt-885x/protocol.h \
267         src/hardware/cem-dt-885x/protocol.c \
268         src/hardware/cem-dt-885x/api.c
269 endif
270 if HW_CENTER_3XX
271 src_libdrivers_la_SOURCES += \
272         src/hardware/center-3xx/protocol.h \
273         src/hardware/center-3xx/protocol.c \
274         src/hardware/center-3xx/api.c
275 endif
276 if HW_CHRONOVU_LA
277 src_libdrivers_la_SOURCES += \
278         src/hardware/chronovu-la/protocol.h \
279         src/hardware/chronovu-la/protocol.c \
280         src/hardware/chronovu-la/api.c
281 endif
282 if HW_COLEAD_SLM
283 src_libdrivers_la_SOURCES += \
284         src/hardware/colead-slm/protocol.h \
285         src/hardware/colead-slm/protocol.c \
286         src/hardware/colead-slm/api.c
287 endif
288 if HW_CONRAD_DIGI_35_CPU
289 src_libdrivers_la_SOURCES += \
290         src/hardware/conrad-digi-35-cpu/protocol.h \
291         src/hardware/conrad-digi-35-cpu/protocol.c \
292         src/hardware/conrad-digi-35-cpu/api.c
293 endif
294 if HW_DCTTECH_USBRELAY
295 src_libdrivers_la_SOURCES += \
296         src/hardware/dcttech-usbrelay/protocol.h \
297         src/hardware/dcttech-usbrelay/protocol.c \
298         src/hardware/dcttech-usbrelay/api.c
299 endif
300 if HW_DEMO
301 src_libdrivers_la_SOURCES += \
302         src/hardware/demo/protocol.h \
303         src/hardware/demo/protocol.c \
304         src/hardware/demo/api.c
305 endif
306 if HW_DREAMSOURCELAB_DSLOGIC
307 src_libdrivers_la_SOURCES += \
308         src/hardware/dreamsourcelab-dslogic/protocol.h \
309         src/hardware/dreamsourcelab-dslogic/protocol.c \
310         src/hardware/dreamsourcelab-dslogic/api.c
311 endif
312 if HW_FLUKE_45
313 src_libdrivers_la_SOURCES += \
314         src/hardware/fluke-45/protocol.h \
315         src/hardware/fluke-45/protocol.c \
316         src/hardware/fluke-45/api.c
317 endif
318 if HW_FLUKE_DMM
319 src_libdrivers_la_SOURCES += \
320         src/hardware/fluke-dmm/protocol.h \
321         src/hardware/fluke-dmm/protocol.c \
322         src/hardware/fluke-dmm/api.c
323 endif
324 if HW_FTDI_LA
325 src_libdrivers_la_SOURCES += \
326         src/hardware/ftdi-la/protocol.h \
327         src/hardware/ftdi-la/protocol.c \
328         src/hardware/ftdi-la/api.c
329 endif
330 if HW_FX2LAFW
331 src_libdrivers_la_SOURCES += \
332         src/hardware/fx2lafw/protocol.h \
333         src/hardware/fx2lafw/protocol.c \
334         src/hardware/fx2lafw/api.c
335 endif
336 if HW_GMC_MH_1X_2X
337 src_libdrivers_la_SOURCES += \
338         src/hardware/gmc-mh-1x-2x/protocol.h \
339         src/hardware/gmc-mh-1x-2x/protocol.c \
340         src/hardware/gmc-mh-1x-2x/api.c
341 endif
342 if HW_GWINSTEK_GDS_800
343 src_libdrivers_la_SOURCES += \
344         src/hardware/gwinstek-gds-800/protocol.h \
345         src/hardware/gwinstek-gds-800/protocol.c \
346         src/hardware/gwinstek-gds-800/api.c
347 endif
348 if HW_GWINSTEK_GPD
349 src_libdrivers_la_SOURCES += \
350         src/hardware/gwinstek-gpd/protocol.h \
351         src/hardware/gwinstek-gpd/protocol.c \
352         src/hardware/gwinstek-gpd/api.c
353 endif
354 if HW_HAMEG_HMO
355 src_libdrivers_la_SOURCES += \
356         src/hardware/hameg-hmo/protocol.h \
357         src/hardware/hameg-hmo/protocol.c \
358         src/hardware/hameg-hmo/api.c
359 endif
360 if HW_HANTEK_4032L
361 src_libdrivers_la_SOURCES += \
362         src/hardware/hantek-4032l/protocol.h \
363         src/hardware/hantek-4032l/protocol.c \
364         src/hardware/hantek-4032l/api.c
365 endif
366 if HW_HANTEK_6XXX
367 src_libdrivers_la_SOURCES += \
368         src/hardware/hantek-6xxx/protocol.h \
369         src/hardware/hantek-6xxx/protocol.c \
370         src/hardware/hantek-6xxx/api.c
371 endif
372 if HW_HANTEK_DSO
373 src_libdrivers_la_SOURCES += \
374         src/hardware/hantek-dso/protocol.h \
375         src/hardware/hantek-dso/protocol.c \
376         src/hardware/hantek-dso/api.c
377 endif
378 if HW_HP_3457A
379 src_libdrivers_la_SOURCES += \
380         src/hardware/hp-3457a/protocol.h \
381         src/hardware/hp-3457a/protocol.c \
382         src/hardware/hp-3457a/api.c
383 endif
384 if HW_HP_3478A
385 src_libdrivers_la_SOURCES += \
386         src/hardware/hp-3478a/protocol.h \
387         src/hardware/hp-3478a/protocol.c \
388         src/hardware/hp-3478a/api.c
389 endif
390 if HW_HP_59306A
391 src_libdrivers_la_SOURCES += \
392         src/hardware/hp-59306a/protocol.h \
393         src/hardware/hp-59306a/protocol.c \
394         src/hardware/hp-59306a/api.c
395 endif
396 if HW_HUNG_CHANG_DSO_2100
397 src_libdrivers_la_SOURCES += \
398         src/hardware/hung-chang-dso-2100/protocol.h \
399         src/hardware/hung-chang-dso-2100/protocol.c \
400         src/hardware/hung-chang-dso-2100/api.c
401 endif
402 if HW_IKALOGIC_SCANALOGIC2
403 src_libdrivers_la_SOURCES += \
404         src/hardware/ikalogic-scanalogic2/protocol.h \
405         src/hardware/ikalogic-scanalogic2/protocol.c \
406         src/hardware/ikalogic-scanalogic2/api.c
407 endif
408 if HW_IKALOGIC_SCANAPLUS
409 src_libdrivers_la_SOURCES += \
410         src/hardware/ikalogic-scanaplus/protocol.h \
411         src/hardware/ikalogic-scanaplus/protocol.c \
412         src/hardware/ikalogic-scanaplus/api.c
413 endif
414 if HW_IPDBG_LA
415 src_libdrivers_la_SOURCES += \
416         src/hardware/ipdbg-la/protocol.h \
417         src/hardware/ipdbg-la/protocol.c \
418         src/hardware/ipdbg-la/api.c
419 endif
420 if HW_ITECH_IT8500
421 src_libdrivers_la_SOURCES += \
422         src/hardware/itech-it8500/protocol.h \
423         src/hardware/itech-it8500/protocol.c \
424         src/hardware/itech-it8500/api.c
425 endif
426 if HW_KECHENG_KC_330B
427 src_libdrivers_la_SOURCES += \
428         src/hardware/kecheng-kc-330b/protocol.h \
429         src/hardware/kecheng-kc-330b/protocol.c \
430         src/hardware/kecheng-kc-330b/api.c
431 endif
432 if HW_KERN_SCALE
433 src_libdrivers_la_SOURCES += \
434         src/hardware/kern-scale/protocol.h \
435         src/hardware/kern-scale/protocol.c \
436         src/hardware/kern-scale/api.c
437 endif
438 if HW_KINGST_LA2016
439 src_libdrivers_la_SOURCES += \
440         src/hardware/kingst-la2016/protocol.h \
441         src/hardware/kingst-la2016/protocol.c \
442         src/hardware/kingst-la2016/api.c
443 endif
444 if HW_KORAD_KAXXXXP
445 src_libdrivers_la_SOURCES += \
446         src/hardware/korad-kaxxxxp/protocol.h \
447         src/hardware/korad-kaxxxxp/protocol.c \
448         src/hardware/korad-kaxxxxp/api.c
449 endif
450 if HW_LASCAR_EL_USB
451 src_libdrivers_la_SOURCES += \
452         src/hardware/lascar-el-usb/protocol.h \
453         src/hardware/lascar-el-usb/protocol.c \
454         src/hardware/lascar-el-usb/api.c
455 endif
456 if HW_LECROY_LOGICSTUDIO
457 src_libdrivers_la_SOURCES += \
458         src/hardware/lecroy-logicstudio/protocol.h \
459         src/hardware/lecroy-logicstudio/protocol.c \
460         src/hardware/lecroy-logicstudio/api.c
461 endif
462 if HW_LECROY_XSTREAM
463 src_libdrivers_la_SOURCES += \
464         src/hardware/lecroy-xstream/protocol.h \
465         src/hardware/lecroy-xstream/protocol.c \
466         src/hardware/lecroy-xstream/api.c
467 endif
468 if HW_MANSON_HCS_3XXX
469 src_libdrivers_la_SOURCES += \
470         src/hardware/manson-hcs-3xxx/protocol.h \
471         src/hardware/manson-hcs-3xxx/protocol.c \
472         src/hardware/manson-hcs-3xxx/api.c
473 endif
474 if HW_MASTECH_MS6514
475 src_libdrivers_la_SOURCES += \
476         src/hardware/mastech-ms6514/protocol.h \
477         src/hardware/mastech-ms6514/protocol.c \
478         src/hardware/mastech-ms6514/api.c
479 endif
480 if HW_MAYNUO_M97
481 src_libdrivers_la_SOURCES += \
482         src/hardware/maynuo-m97/protocol.h \
483         src/hardware/maynuo-m97/protocol.c \
484         src/hardware/maynuo-m97/api.c
485 endif
486 if HW_MICROCHIP_PICKIT2
487 src_libdrivers_la_SOURCES += \
488         src/hardware/microchip-pickit2/protocol.h \
489         src/hardware/microchip-pickit2/protocol.c \
490         src/hardware/microchip-pickit2/api.c
491 endif
492 if HW_MIC_985XX
493 src_libdrivers_la_SOURCES += \
494         src/hardware/mic-985xx/protocol.h \
495         src/hardware/mic-985xx/protocol.c \
496         src/hardware/mic-985xx/api.c
497 endif
498 if HW_MOOSHIMETER_DMM
499 src_libdrivers_la_SOURCES += \
500         src/hardware/mooshimeter-dmm/protocol.h \
501         src/hardware/mooshimeter-dmm/protocol.c \
502         src/hardware/mooshimeter-dmm/api.c
503 endif
504 if HW_MOTECH_LPS_30X
505 src_libdrivers_la_SOURCES += \
506         src/hardware/motech-lps-30x/protocol.h \
507         src/hardware/motech-lps-30x/protocol.c \
508         src/hardware/motech-lps-30x/api.c
509 endif
510 if HW_NORMA_DMM
511 src_libdrivers_la_SOURCES += \
512         src/hardware/norma-dmm/protocol.h \
513         src/hardware/norma-dmm/protocol.c \
514         src/hardware/norma-dmm/api.c
515 endif
516 if HW_OPENBENCH_LOGIC_SNIFFER
517 src_libdrivers_la_SOURCES += \
518         src/hardware/openbench-logic-sniffer/protocol.h \
519         src/hardware/openbench-logic-sniffer/protocol.c \
520         src/hardware/openbench-logic-sniffer/api.c
521 endif
522 if HW_PCE_322A
523 src_libdrivers_la_SOURCES += \
524         src/hardware/pce-322a/protocol.h \
525         src/hardware/pce-322a/protocol.c \
526         src/hardware/pce-322a/api.c
527 endif
528 if HW_PIPISTRELLO_OLS
529 src_libdrivers_la_SOURCES += \
530         src/hardware/pipistrello-ols/protocol.h \
531         src/hardware/pipistrello-ols/protocol.c \
532         src/hardware/pipistrello-ols/api.c
533 endif
534 if HW_RDTECH_DPS
535 src_libdrivers_la_SOURCES += \
536         src/hardware/rdtech-dps/protocol.h \
537         src/hardware/rdtech-dps/protocol.c \
538         src/hardware/rdtech-dps/api.c
539 endif
540 if HW_RDTECH_UM
541 src_libdrivers_la_SOURCES += \
542         src/hardware/rdtech-um/protocol.h \
543         src/hardware/rdtech-um/protocol.c \
544         src/hardware/rdtech-um/api.c
545 endif
546 if HW_RDTECH_TC
547 src_libdrivers_la_SOURCES += \
548         src/hardware/rdtech-tc/protocol.h \
549         src/hardware/rdtech-tc/protocol.c \
550         src/hardware/rdtech-tc/api.c
551 endif
552 if HW_RIGOL_DG
553 src_libdrivers_la_SOURCES += \
554         src/hardware/rigol-dg/protocol.h \
555         src/hardware/rigol-dg/protocol.c \
556         src/hardware/rigol-dg/api.c
557 endif
558 if HW_RIGOL_DS
559 src_libdrivers_la_SOURCES += \
560         src/hardware/rigol-ds/protocol.h \
561         src/hardware/rigol-ds/protocol.c \
562         src/hardware/rigol-ds/api.c
563 endif
564 if HW_ROHDE_SCHWARZ_SME_0X
565 src_libdrivers_la_SOURCES += \
566         src/hardware/rohde-schwarz-sme-0x/protocol.h \
567         src/hardware/rohde-schwarz-sme-0x/protocol.c \
568         src/hardware/rohde-schwarz-sme-0x/api.c
569 endif
570 if HW_SALEAE_LOGIC16
571 src_libdrivers_la_SOURCES += \
572         src/hardware/saleae-logic16/protocol.h \
573         src/hardware/saleae-logic16/protocol.c \
574         src/hardware/saleae-logic16/api.c
575 endif
576 if HW_SALEAE_LOGIC_PRO
577 src_libdrivers_la_SOURCES += \
578         src/hardware/saleae-logic-pro/protocol.h \
579         src/hardware/saleae-logic-pro/protocol.c \
580         src/hardware/saleae-logic-pro/api.c
581 endif
582 if HW_SCPI_DMM
583 src_libdrivers_la_SOURCES += \
584         src/hardware/scpi-dmm/protocol.h \
585         src/hardware/scpi-dmm/protocol.c \
586         src/hardware/scpi-dmm/api.c
587 endif
588 if HW_SCPI_PPS
589 src_libdrivers_la_SOURCES += \
590         src/hardware/scpi-pps/protocol.h \
591         src/hardware/scpi-pps/protocol.c \
592         src/hardware/scpi-pps/profiles.c \
593         src/hardware/scpi-pps/api.c
594 endif
595 if HW_SERIAL_DMM
596 src_libdrivers_la_SOURCES += \
597         src/hardware/serial-dmm/protocol.h \
598         src/hardware/serial-dmm/protocol.c \
599         src/hardware/serial-dmm/api.c
600 endif
601 if HW_SERIAL_LCR
602 src_libdrivers_la_SOURCES += \
603         src/hardware/serial-lcr/protocol.h \
604         src/hardware/serial-lcr/protocol.c \
605         src/hardware/serial-lcr/api.c
606 endif
607 if HW_SIGLENT_SDS
608 src_libdrivers_la_SOURCES += \
609         src/hardware/siglent-sds/protocol.h \
610         src/hardware/siglent-sds/protocol.c \
611         src/hardware/siglent-sds/api.c
612 endif
613 if HW_SYSCLK_LWLA
614 src_libdrivers_la_SOURCES += \
615         src/hardware/sysclk-lwla/lwla.h \
616         src/hardware/sysclk-lwla/lwla.c \
617         src/hardware/sysclk-lwla/lwla1016.c \
618         src/hardware/sysclk-lwla/lwla1034.c \
619         src/hardware/sysclk-lwla/protocol.h \
620         src/hardware/sysclk-lwla/protocol.c \
621         src/hardware/sysclk-lwla/api.c
622 endif
623 if HW_SYSCLK_SLA5032
624 src_libdrivers_la_SOURCES += \
625         src/hardware/sysclk-sla5032/protocol.h \
626         src/hardware/sysclk-sla5032/protocol.c \
627         src/hardware/sysclk-sla5032/api.c
628 endif
629 if HW_TELEINFO
630 src_libdrivers_la_SOURCES += \
631         src/hardware/teleinfo/protocol.h \
632         src/hardware/teleinfo/protocol.c \
633         src/hardware/teleinfo/api.c
634 endif
635 if HW_TESTO
636 src_libdrivers_la_SOURCES += \
637         src/hardware/testo/protocol.h \
638         src/hardware/testo/protocol.c \
639         src/hardware/testo/api.c
640 endif
641 if HW_TONDAJ_SL_814
642 src_libdrivers_la_SOURCES += \
643         src/hardware/tondaj-sl-814/protocol.h \
644         src/hardware/tondaj-sl-814/protocol.c \
645         src/hardware/tondaj-sl-814/api.c
646 endif
647 if HW_UNI_T_DMM
648 src_libdrivers_la_SOURCES += \
649         src/hardware/uni-t-dmm/protocol.h \
650         src/hardware/uni-t-dmm/protocol.c \
651         src/hardware/uni-t-dmm/api.c
652 endif
653 if HW_UNI_T_UT181A
654 src_libdrivers_la_SOURCES += \
655         src/hardware/uni-t-ut181a/protocol.h \
656         src/hardware/uni-t-ut181a/protocol.c \
657         src/hardware/uni-t-ut181a/api.c
658 endif
659 if HW_UNI_T_UT32X
660 src_libdrivers_la_SOURCES += \
661         src/hardware/uni-t-ut32x/protocol.h \
662         src/hardware/uni-t-ut32x/protocol.c \
663         src/hardware/uni-t-ut32x/api.c
664 endif
665 if HW_YOKOGAWA_DLM
666 src_libdrivers_la_SOURCES += \
667         src/hardware/yokogawa-dlm/protocol.h \
668         src/hardware/yokogawa-dlm/protocol.c \
669         src/hardware/yokogawa-dlm/protocol_wrappers.h \
670         src/hardware/yokogawa-dlm/protocol_wrappers.c \
671         src/hardware/yokogawa-dlm/api.c
672 endif
673 if HW_ZEROPLUS_LOGIC_CUBE
674 src_libdrivers_la_SOURCES += \
675         src/hardware/zeroplus-logic-cube/analyzer.c \
676         src/hardware/zeroplus-logic-cube/analyzer.h \
677         src/hardware/zeroplus-logic-cube/gl_usb.h \
678         src/hardware/zeroplus-logic-cube/gl_usb.c \
679         src/hardware/zeroplus-logic-cube/protocol.h \
680         src/hardware/zeroplus-logic-cube/protocol.c \
681         src/hardware/zeroplus-logic-cube/api.c
682 endif
683 if HW_ZKETECH_EBD_USB
684 src_libdrivers_la_SOURCES += \
685         src/hardware/zketech-ebd-usb/protocol.h \
686         src/hardware/zketech-ebd-usb/protocol.c \
687         src/hardware/zketech-ebd-usb/api.c
688 endif
689
690 libsigrok_la_LIBADD = src/libdrivers.lo $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
691 libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
692
693 library_includedir = $(includedir)/libsigrok
694 library_include_HEADERS = \
695         include/libsigrok/libsigrok.h \
696         include/libsigrok/proto.h
697 nodist_library_include_HEADERS = \
698         include/libsigrok/version.h
699 noinst_HEADERS = src/libsigrok-internal.h
700
701 pkgconfigdir = $(libdir)/pkgconfig
702 pkgconfig_DATA = libsigrok.pc
703
704 mimeappdir = $(datadir)/mime/packages
705 mimeapp_DATA = contrib/vnd.sigrok.session.xml
706
707 mimeicondir = $(datadir)/icons/hicolor/48x48/mimetypes
708 mimeicon_DATA = contrib/libsigrok.png
709
710 mimeiconscalabledir = $(datadir)/icons/hicolor/scalable/mimetypes
711 mimeiconscalable_DATA = contrib/libsigrok.svg
712
713 EXTRA_DIST = \
714         Doxyfile \
715         HACKING \
716         README.devices \
717         bindings/cxx/ConfigKey_methods.cpp \
718         bindings/cxx/ConfigKey_methods.hpp \
719         bindings/cxx/ConfigKey_methods.i \
720         bindings/cxx/Doxyfile \
721         bindings/cxx/QuantityFlag_methods.cpp \
722         bindings/cxx/QuantityFlag_methods.hpp \
723         bindings/cxx/enums.py \
724         bindings/python/Doxyfile \
725         bindings/python/setup.py \
726         bindings/python/sigrok/__init__.py \
727         bindings/python/sigrok/core/__init__.py \
728         bindings/python/sigrok/core/classes.i \
729         bindings/ruby/classes.i \
730         bindings/java/Doxyfile \
731         bindings/java/org/sigrok/core/classes/classes.i \
732         bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
733         bindings/java/org/sigrok/core/interfaces/LogCallback.java \
734         bindings/swig/classes.i \
735         bindings/swig/doc.py \
736         bindings/swig/templates.i \
737         contrib/libsigrok_112x112.png \
738         contrib/libsigrok.png \
739         contrib/libsigrok.svg \
740         contrib/vnd.sigrok.session.xml \
741         contrib/60-libsigrok.rules \
742         contrib/61-libsigrok-plugdev.rules \
743         contrib/61-libsigrok-uaccess.rules
744
745 if HAVE_CHECK
746 TESTS = tests/main
747 check_PROGRAMS = ${TESTS}
748 endif
749
750 tests_main_SOURCES = \
751         include/libsigrok/libsigrok.h \
752         tests/lib.c \
753         tests/lib.h \
754         tests/main.c \
755         tests/core.c \
756         tests/input_all.c \
757         tests/input_binary.c \
758         tests/output_all.c \
759         tests/transform_all.c \
760         tests/session.c \
761         tests/strutil.c \
762         tests/version.c \
763         tests/driver_all.c \
764         tests/device.c \
765         tests/trigger.c \
766         tests/analog.c \
767         tests/conv.c
768
769 tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
770
771 BUILD_EXTRA =
772 INSTALL_EXTRA =
773 UNINSTALL_EXTRA =
774 CLEAN_EXTRA =
775
776 libsigrok-uninstall:
777         -rmdir $(DESTDIR)$(includedir)/libsigrok
778
779 UNINSTALL_EXTRA += libsigrok-uninstall
780
781 if BINDINGS_CXX
782
783 lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
784
785 bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
786
787 bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS) $(SR_EXTRA_CXX_LIBS)
788 bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
789
790 bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
791 bindings_cxx_libsigrokcxx_la_include_HEADERS = \
792         bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
793 nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
794         bindings/cxx/include/libsigrokcxx/enums.hpp
795
796 pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
797
798 doxy/xml/index.xml: include/libsigrok/libsigrok.h
799         $(AM_V_GEN)cd $(srcdir) && SRCDIR=$(abs_srcdir)/ BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
800
801 bindings/swig/enums.i: bindings/cxx/enums.timestamp
802 bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
803 bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
804
805 bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
806                 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
807         $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
808         $(AM_V_at)touch $@
809
810 bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
811                 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
812
813 cxx-clean:
814         rm -rf doxy/
815         rm -rf bindings/cxx/doxy/
816         rm -f bindings/swig/enums.i
817         rm -f bindings/cxx/enums.cpp
818         rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
819         rm -f bindings/cxx/enums.timestamp
820
821 CLEAN_EXTRA += cxx-clean
822
823 cxx-uninstall:
824         -rmdir $(DESTDIR)$(includedir)/libsigrokcxx
825
826 UNINSTALL_EXTRA += cxx-uninstall
827
828 endif
829
830 CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
831
832 $(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
833                 bindings/cxx/enums.timestamp
834         $(AM_V_GEN)cd $(srcdir)/bindings/cxx && SRCDIR=$(abs_srcdir)/bindings/cxx/ BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
835
836 # Macro definitions to be used by the SWIG parser.
837 swig_defs = -Dnoexcept= -Dprivate=protected -DG_GNUC_BEGIN_IGNORE_DEPRECATIONS= -DG_GNUC_END_IGNORE_DEPRECATIONS=
838
839 if BINDINGS_PYTHON
840
841 PDIR = bindings/python
842 PDOC_START = bindings/python/sigrok/core/doc_start.i
843 PDOC_END = bindings/python/sigrok/core/doc_end.i
844
845 setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CXX='$(CXX)' CFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' CXXFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' LDADD='$(PYSIGROK_LIBS)'
846 setup_quiet = --quiet
847 setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
848
849 $(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
850         $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
851         $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
852
853 $(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
854         $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
855         $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
856
857 python-build: $(PDIR)/timestamp
858
859 $(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
860                 bindings/swig/classes.i bindings/swig/templates.i \
861                 bindings/swig/enums.i $(PDOC_START) $(PDOC_END) \
862                 $(library_include_HEADERS) \
863                 $(nodist_library_include_HEADERS) \
864                 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
865                 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
866                 @ORDER@ bindings/cxx/libsigrokcxx.la
867         $(AM_V_at)$(setup_py) clean --all 2>/dev/null
868         $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" --swig-opts '$(swig_defs)' build_py
869         $(AM_V_at): >$@
870
871 python-install:
872         $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
873         destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
874                 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
875
876 python-clean:
877         -$(AM_V_at)rm -f $(PDIR)/timestamp
878         -$(AM_V_at)rm -fr $(PDIR)/doxy
879         -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
880
881 python-doc:
882         $(AM_V_at)cd $(srcdir)/$(PDIR) && SRCDIR="$(abs_srcdir)/$(PDIR)/" BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
883
884 BUILD_EXTRA += python-build
885 INSTALL_EXTRA += python-install
886 CLEAN_EXTRA += python-clean
887
888 endif
889
890 if BINDINGS_RUBY
891
892 RDIR = bindings/ruby
893 RDOC = $(RDIR)/doc.i
894 RWRAP = $(RDIR)/classes_wrap.cpp
895 ROBJ = $(RWRAP:.cpp=.o)
896 REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
897
898 $(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
899         $(AM_V_at)test -d $(RDIR) || $(MKDIR_P) $(RDIR)
900         $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
901
902 $(RWRAP): $(srcdir)/$(RDIR)/classes.i $(RDOC) \
903                 bindings/swig/classes.i bindings/swig/templates.i \
904                 bindings/swig/enums.i
905         $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include -I$(RDIR) $(local_includes) $(swig_defs) -o $@ $(srcdir)/$(RDIR)/classes.i
906
907 $(ROBJ): $(RWRAP) \
908                 $(library_include_HEADERS) \
909                 $(nodist_library_include_HEADERS) \
910                 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
911                 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
912         $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include $(local_includes) -fPIC -o $@ -c $(RWRAP)
913
914 $(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
915         $(AM_V_CXXLD)$(CXX) -shared -o $@ $(ROBJ) -lsigrokcxx -Lbindings/cxx/.libs $(RBSIGROK_LIBS)
916
917 ruby-build: $(REXT)
918
919 ruby-install: $(REXT)
920         $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
921         $(INSTALL) $(REXT) $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
922
923 ruby-uninstall:
924         rm -f $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)/sigrok.$(RUBY_DLEXT)
925
926 ruby-clean:
927         -$(AM_V_at)rm -fr $(RDIR)/doc
928         -$(AM_V_at)rm -f $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
929
930 ruby-doc: $(RWRAP)
931         $(AM_V_at)yard doc -o $(RDIR)/doc $(RWRAP)
932
933 BUILD_EXTRA += ruby-build
934 INSTALL_EXTRA += ruby-install
935 UNINSTALL_EXTRA += ruby-uninstall
936 CLEAN_EXTRA += ruby-clean
937
938 endif
939
940 if BINDINGS_JAVA
941
942 JDIR = bindings/java
943 JPKG = org/sigrok/core
944 JCLS = $(JDIR)/$(JPKG)/classes
945 JINT = $(JDIR)/$(JPKG)/interfaces
946 JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
947 JSWG = $(JCLS)/classes.i
948 JDOC = $(JCLS)/doc.i
949 JCXX = $(JCLS)/classes_wrap.cxx
950 JLIB = $(JDIR)/libsigrok_java_core_classes.so
951 JJAR = $(JDIR)/sigrok-core.jar
952
953 java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
954
955 java-build: $(JJAR) $(JLIB)
956
957 $(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
958         $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
959         $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
960
961 $(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i \
962                 bindings/swig/templates.i bindings/swig/enums.i \
963                 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
964                 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
965         -$(AM_V_at)rm -f $(java_cleanfiles)
966         $(AM_V_GEN)$(SWIG) -c++ $(swig_defs) \
967                 -java -package org.sigrok.core.classes \
968                 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
969                 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
970
971 $(JJAR): $(JCXX)
972         $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
973         $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
974
975 $(JLIB): $(JCXX) \
976                 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
977                 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
978                 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
979                 @ORDER@ bindings/cxx/libsigrokcxx.la
980         $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) $(LDFLAGS) -L.libs -Lbindings/cxx/.libs \
981                 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
982                 -lsigrokcxx $(LIBSIGROKCXX_LIBS) $(SR_EXTRA_CXX_LIBS) -o $(JLIB)
983
984 java-install:
985         $(INSTALL) -d $(DESTDIR)$(libdir)/jni
986         $(INSTALL) $(JLIB) $(DESTDIR)$(libdir)/jni
987         $(INSTALL) -d $(DESTDIR)$(datadir)/java
988         $(INSTALL) $(JJAR) $(DESTDIR)$(datadir)/java
989
990 java-uninstall:
991         -rm -f $(DESTDIR)$(datadir)/java/sigrok-core.jar
992         -rm -f $(DESTDIR)$(libdir)/jni/libsigrok_java_core_classes.so
993
994 java-clean:
995         -$(AM_V_at)rm -f $(java_cleanfiles) $(JDOC)
996         -$(AM_V_at)rm -fr $(JDIR)/doxy
997
998 java-doc:
999         $(AM_V_at)cd $(srcdir)/$(JDIR) && SRCDIR="$(abs_srcdir)/$(JDIR)/" BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
1000
1001 BUILD_EXTRA += java-build
1002 INSTALL_EXTRA += java-install
1003 UNINSTALL_EXTRA += java-uninstall
1004 CLEAN_EXTRA += java-clean
1005
1006 endif
1007
1008 all-local: $(BUILD_EXTRA)
1009 install-exec-local: $(INSTALL_EXTRA)
1010 uninstall-hook: $(UNINSTALL_EXTRA)
1011 clean-local: $(CLEAN_EXTRA)
1012
1013 .PHONY: dist-changelog
1014
1015 dist-hook: dist-changelog
1016
1017 dist-changelog:
1018         $(AM_V_at)if test ! -d '$(top_srcdir)/.git'; then \
1019                 cp -f '$(top_srcdir)/ChangeLog' "$(top_distdir)/ChangeLog"; \
1020         elif git -C '$(top_srcdir)' log >.ChangeLog.tmp; then \
1021                 mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
1022         else \
1023                 rm -f .ChangeLog.tmp; exit 1; \
1024         fi
1025