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