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