]> sigrok.org Git - libsigrok.git/blame - Makefile.am
Put driver pointers into special section
[libsigrok.git] / Makefile.am
CommitLineData
62c82025 1##
50985c20 2## This file is part of the libsigrok project.
62c82025 3##
c73d2ea4 4## Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
d375b3c3 5## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
62c82025 6##
a1bb33af
UH
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.
62c82025 11##
a1bb33af
UH
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.
62c82025 16##
a1bb33af
UH
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/>.
62c82025 19##
a1bb33af 20
ea1d5351 21ACLOCAL_AMFLAGS = -I m4
ba1c29dc 22AM_LIBTOOLFLAGS = --silent
bcc3694f 23GNUMAKEFLAGS = --no-print-directory
ba1c29dc 24
9448951d
DE
25# distutils/setuptools cause trouble on distcheck. Disable for now.
26DISTCHECK_CONFIGURE_FLAGS = --disable-python
27
ba1c29dc 28FIRMWARE_DIR = $(datadir)/sigrok-firmware
826938d8 29
9ac018d0 30local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I.
1f61c22f 31if BINDINGS_CXX
4cf2f34f 32local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
1f61c22f 33endif
655b116c
DE
34# Do not hard-code the firmware location on Windows.
35if WIN32
36global_defs =
37else
38global_defs = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
39endif
1f61c22f 40# Ensure that local include directories are always searched first.
655b116c 41AM_CPPFLAGS = $(local_includes) $(global_defs)
340f6e7a 42
65489c1a 43# The tests CFLAGS are a superset of the libsigrok CFLAGS, and the
1f61c22f 44# python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
65489c1a 45AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(TESTS_CFLAGS)
0441038e 46AM_CXXFLAGS = $(SR_WXXFLAGS) $(LIBSIGROKCXX_CFLAGS)
1f61c22f 47
8a7b47cd 48lib_LTLIBRARIES = libsigrok.la
a1bb33af 49
67bd8055 50# Backend files
a695d6c0 51libsigrok_la_SOURCES = \
155b680d
BV
52 src/backend.c \
53 src/device.c \
54 src/session.c \
55 src/session_file.c \
56 src/session_driver.c \
155b680d
BV
57 src/hwdriver.c \
58 src/trigger.c \
59 src/soft-trigger.c \
fb019a0e 60 src/analog.c \
24287ea9 61 src/fallback.c \
bee24666 62 src/resource.c \
155b680d
BV
63 src/strutil.c \
64 src/log.c \
65 src/version.c \
66 src/error.c \
aea4e458
LPC
67 src/std.c \
68 src/sw_limits.c
960a75e4 69
155b680d
BV
70# Input modules
71libsigrok_la_SOURCES += \
155b680d 72 src/input/input.c \
b84cba4d 73 src/input/binary.c \
02e24c0c 74 src/input/chronovu_la8.c \
41d214f6 75 src/input/csv.c \
e6b15cb5 76 src/input/raw_analog.c \
6d2897e3 77 src/input/trace32_ad.c \
7db06394 78 src/input/vcd.c \
155b680d 79 src/input/wav.c
67bd8055 80
155b680d
BV
81# Output modules
82libsigrok_la_SOURCES += \
83 src/output/output.c \
84 src/output/analog.c \
85 src/output/ascii.c \
86 src/output/bits.c \
87 src/output/binary.c \
88 src/output/csv.c \
89 src/output/chronovu_la8.c \
afaa75b9 90 src/output/wav.c \
155b680d
BV
91 src/output/gnuplot.c \
92 src/output/hex.c \
93 src/output/ols.c \
3250d8c7 94 src/output/srzip.c \
155b680d 95 src/output/vcd.c
67bd8055 96
988357ca
UH
97# Transform modules
98libsigrok_la_SOURCES += \
39f1752e 99 src/transform/transform.c \
43caa466 100 src/transform/nop.c \
d74d30bb
UH
101 src/transform/scale.c \
102 src/transform/invert.c
988357ca 103
155b680d 104# SCPI support
67bd8055 105libsigrok_la_SOURCES += \
0a9d05dc 106 src/scpi.h \
155b680d 107 src/scpi/scpi.c \
91ef511d 108 src/scpi/helpers.c \
155b680d 109 src/scpi/scpi_tcp.c
67bd8055
UH
110if NEED_RPC
111libsigrok_la_SOURCES += \
155b680d
BV
112 src/scpi/scpi_vxi.c \
113 src/scpi/vxi_clnt.c \
114 src/scpi/vxi_xdr.c \
115 src/scpi/vxi.h
67bd8055
UH
116endif
117if NEED_SERIAL
118libsigrok_la_SOURCES += \
155b680d
BV
119 src/serial.c \
120 src/scpi/scpi_serial.c
67bd8055
UH
121endif
122if NEED_USB
123libsigrok_la_SOURCES += \
155b680d
BV
124 src/ezusb.c \
125 src/usb.c \
126 src/scpi/scpi_usbtmc_libusb.c
67bd8055
UH
127endif
128if NEED_VISA
129libsigrok_la_SOURCES += \
155b680d 130 src/scpi/scpi_visa.c
67bd8055 131endif
bb2a4ed4
ML
132if NEED_GPIB
133libsigrok_la_SOURCES += \
7343ad1e 134 src/scpi/scpi_libgpib.c
bb2a4ed4 135endif
67bd8055 136
f54ebe0c 137# Modbus support
daa39012
AJ
138libsigrok_la_SOURCES += \
139 src/modbus/modbus.c
4c938fc2
AJ
140if NEED_SERIAL
141libsigrok_la_SOURCES += \
142 src/modbus/modbus_serial_rtu.c
143endif
daa39012 144
155b680d
BV
145# Hardware (DMM chip parsers)
146libsigrok_la_SOURCES += \
147 src/dmm/es519xx.c \
148 src/dmm/fs9721.c \
149 src/dmm/fs9922.c \
150 src/dmm/m2110.c \
151 src/dmm/metex14.c \
a24c3f4a 152 src/dmm/rs9lcd.c \
626027df 153 src/dmm/bm25x.c \
f3cde309 154 src/dmm/ut71x.c \
c36f78f7 155 src/dmm/ut372.c \
eed3dec8
MG
156 src/dmm/vc870.c \
157 src/dmm/dtm0660.c
67bd8055 158
6bcb3ee8 159# Hardware (LCR chip parsers)
d378f100 160if NEED_SERIAL
6bcb3ee8
JH
161libsigrok_la_SOURCES += \
162 src/lcr/es51919.c
d378f100 163endif
6bcb3ee8 164
e5d953b5
UH
165# Hardware (Scale protocol parsers)
166libsigrok_la_SOURCES += \
167 src/scale/kern.c
168
67bd8055 169# Hardware drivers
dd5c48a6
LPC
170
171# This entry must be placed before all drivers
172libsigrok_la_SOURCES += src/hardware/driver_list_start.c
173
67bd8055
UH
174if HW_AGILENT_DMM
175libsigrok_la_SOURCES += \
155b680d
BV
176 src/hardware/agilent-dmm/api.c \
177 src/hardware/agilent-dmm/agilent-dmm.h \
178 src/hardware/agilent-dmm/sched.c
67bd8055 179endif
67bd8055
UH
180if HW_APPA_55II
181libsigrok_la_SOURCES += \
155b680d
BV
182 src/hardware/appa-55ii/protocol.h \
183 src/hardware/appa-55ii/protocol.c \
184 src/hardware/appa-55ii/api.c
67bd8055 185endif
6e8d31d4
UH
186if HW_ARACHNID_LABS_RE_LOAD_PRO
187libsigrok_la_SOURCES += \
188 src/hardware/arachnid-labs-re-load-pro/protocol.h \
189 src/hardware/arachnid-labs-re-load-pro/protocol.c \
190 src/hardware/arachnid-labs-re-load-pro/api.c
191endif
67bd8055
UH
192if HW_ASIX_SIGMA
193libsigrok_la_SOURCES += \
3ba56876 194 src/hardware/asix-sigma/protocol.h \
195 src/hardware/asix-sigma/protocol.c \
196 src/hardware/asix-sigma/api.c
67bd8055
UH
197endif
198if HW_ATTEN_PPS3XXX
199libsigrok_la_SOURCES += \
155b680d
BV
200 src/hardware/atten-pps3xxx/protocol.h \
201 src/hardware/atten-pps3xxx/protocol.c \
202 src/hardware/atten-pps3xxx/api.c
67bd8055 203endif
dfaee1de
BG
204if HW_BAYLIBRE_ACME
205libsigrok_la_SOURCES += \
206 src/hardware/baylibre-acme/protocol.h \
207 src/hardware/baylibre-acme/protocol.c \
289eebd7
BG
208 src/hardware/baylibre-acme/api.c \
209 src/hardware/baylibre-acme/gpio.h \
210 src/hardware/baylibre-acme/gpio.c
dfaee1de 211endif
bb993797
KA
212if HW_BEAGLELOGIC
213libsigrok_la_SOURCES += \
3db4b08b 214 src/hardware/beaglelogic/beaglelogic.h \
155b680d
BV
215 src/hardware/beaglelogic/protocol.h \
216 src/hardware/beaglelogic/protocol.c \
217 src/hardware/beaglelogic/api.c
bb993797 218endif
67bd8055
UH
219if HW_BRYMEN_BM86X
220libsigrok_la_SOURCES += \
155b680d
BV
221 src/hardware/brymen-bm86x/protocol.h \
222 src/hardware/brymen-bm86x/protocol.c \
223 src/hardware/brymen-bm86x/api.c
67bd8055
UH
224endif
225if HW_BRYMEN_DMM
226libsigrok_la_SOURCES += \
155b680d
BV
227 src/hardware/brymen-dmm/parser.c \
228 src/hardware/brymen-dmm/protocol.h \
229 src/hardware/brymen-dmm/protocol.c \
230 src/hardware/brymen-dmm/api.c
67bd8055
UH
231endif
232if HW_CEM_DT_885X
233libsigrok_la_SOURCES += \
155b680d
BV
234 src/hardware/cem-dt-885x/protocol.h \
235 src/hardware/cem-dt-885x/protocol.c \
236 src/hardware/cem-dt-885x/api.c
67bd8055
UH
237endif
238if HW_CENTER_3XX
239libsigrok_la_SOURCES += \
155b680d
BV
240 src/hardware/center-3xx/protocol.h \
241 src/hardware/center-3xx/protocol.c \
242 src/hardware/center-3xx/api.c
67bd8055 243endif
7b356712 244if HW_CHRONOVU_LA
67bd8055 245libsigrok_la_SOURCES += \
155b680d
BV
246 src/hardware/chronovu-la/protocol.h \
247 src/hardware/chronovu-la/protocol.c \
248 src/hardware/chronovu-la/api.c
67bd8055
UH
249endif
250if HW_COLEAD_SLM
251libsigrok_la_SOURCES += \
155b680d
BV
252 src/hardware/colead-slm/protocol.h \
253 src/hardware/colead-slm/protocol.c \
254 src/hardware/colead-slm/api.c
67bd8055
UH
255endif
256if HW_CONRAD_DIGI_35_CPU
257libsigrok_la_SOURCES += \
155b680d
BV
258 src/hardware/conrad-digi-35-cpu/protocol.h \
259 src/hardware/conrad-digi-35-cpu/protocol.c \
260 src/hardware/conrad-digi-35-cpu/api.c
67bd8055
UH
261endif
262if HW_DEMO
263libsigrok_la_SOURCES += \
155b680d 264 src/hardware/demo/demo.c
67bd8055 265endif
b5089195
JH
266if HW_DEREE_DE5000
267libsigrok_la_SOURCES += \
268 src/hardware/deree-de5000/api.c
269endif
67bd8055
UH
270if HW_FLUKE_DMM
271libsigrok_la_SOURCES += \
155b680d
BV
272 src/hardware/fluke-dmm/fluke-dmm.h \
273 src/hardware/fluke-dmm/fluke.c \
274 src/hardware/fluke-dmm/api.c
67bd8055 275endif
f2273382 276if HW_FTDI_LA
4f7fdcdd 277libsigrok_la_SOURCES += \
f2273382
UH
278 src/hardware/ftdi-la/protocol.h \
279 src/hardware/ftdi-la/protocol.c \
280 src/hardware/ftdi-la/api.c
4f7fdcdd 281endif
67bd8055
UH
282if HW_FX2LAFW
283libsigrok_la_SOURCES += \
155b680d
BV
284 src/hardware/fx2lafw/protocol.h \
285 src/hardware/fx2lafw/protocol.c \
a7d7f93c 286 src/hardware/fx2lafw/api.c \
b9d53092
BV
287 src/hardware/fx2lafw/dslogic.c \
288 src/hardware/fx2lafw/dslogic.h
67bd8055
UH
289endif
290if HW_GMC_MH_1X_2X
291libsigrok_la_SOURCES += \
155b680d
BV
292 src/hardware/gmc-mh-1x-2x/protocol.h \
293 src/hardware/gmc-mh-1x-2x/protocol.c \
294 src/hardware/gmc-mh-1x-2x/api.c
67bd8055 295endif
7c198f96
ML
296if HW_GWINSTEK_GDS_800
297libsigrok_la_SOURCES += \
298 src/hardware/gwinstek-gds-800/protocol.h \
299 src/hardware/gwinstek-gds-800/protocol.c \
300 src/hardware/gwinstek-gds-800/api.c
301endif
67bd8055
UH
302if HW_HAMEG_HMO
303libsigrok_la_SOURCES += \
155b680d
BV
304 src/hardware/hameg-hmo/protocol.h \
305 src/hardware/hameg-hmo/protocol.c \
306 src/hardware/hameg-hmo/api.c
67bd8055 307endif
6c6bc80a
C
308if HW_HANTEK_6XXX
309libsigrok_la_SOURCES += \
310 src/hardware/hantek-6xxx/protocol.h \
311 src/hardware/hantek-6xxx/protocol.c \
312 src/hardware/hantek-6xxx/api.c
313endif
67bd8055
UH
314if HW_HANTEK_DSO
315libsigrok_la_SOURCES += \
155b680d
BV
316 src/hardware/hantek-dso/dso.h \
317 src/hardware/hantek-dso/dso.c \
318 src/hardware/hantek-dso/api.c
67bd8055 319endif
00b2a092
AG
320if HW_HP_3457A
321libsigrok_la_SOURCES += \
322 src/hardware/hp-3457a/protocol.h \
323 src/hardware/hp-3457a/protocol.c \
324 src/hardware/hp-3457a/api.c
325endif
05ac4a98
DG
326if HW_HUNG_CHANG_DSO_2100
327libsigrok_la_SOURCES += \
328 src/hardware/hung-chang-dso-2100/protocol.h \
329 src/hardware/hung-chang-dso-2100/protocol.c \
330 src/hardware/hung-chang-dso-2100/api.c
331endif
67bd8055
UH
332if HW_IKALOGIC_SCANALOGIC2
333libsigrok_la_SOURCES += \
155b680d
BV
334 src/hardware/ikalogic-scanalogic2/protocol.h \
335 src/hardware/ikalogic-scanalogic2/protocol.c \
336 src/hardware/ikalogic-scanalogic2/api.c
67bd8055
UH
337endif
338if HW_IKALOGIC_SCANAPLUS
339libsigrok_la_SOURCES += \
155b680d
BV
340 src/hardware/ikalogic-scanaplus/protocol.h \
341 src/hardware/ikalogic-scanaplus/protocol.c \
342 src/hardware/ikalogic-scanaplus/api.c
67bd8055
UH
343endif
344if HW_KECHENG_KC_330B
345libsigrok_la_SOURCES += \
155b680d
BV
346 src/hardware/kecheng-kc-330b/protocol.h \
347 src/hardware/kecheng-kc-330b/protocol.c \
348 src/hardware/kecheng-kc-330b/api.c
67bd8055 349endif
9380ec2f
UH
350if HW_KERN_SCALE
351libsigrok_la_SOURCES += \
352 src/hardware/kern-scale/protocol.h \
353 src/hardware/kern-scale/protocol.c \
354 src/hardware/kern-scale/api.c
355endif
16fc7ee2 356if HW_KORAD_KAXXXXP
e75ee7de 357libsigrok_la_SOURCES += \
16fc7ee2
UH
358 src/hardware/korad-kaxxxxp/protocol.h \
359 src/hardware/korad-kaxxxxp/protocol.c \
360 src/hardware/korad-kaxxxxp/api.c
e75ee7de 361endif
67bd8055
UH
362if HW_LASCAR_EL_USB
363libsigrok_la_SOURCES += \
155b680d
BV
364 src/hardware/lascar-el-usb/protocol.h \
365 src/hardware/lascar-el-usb/protocol.c \
366 src/hardware/lascar-el-usb/api.c
67bd8055 367endif
c7b17bcb
TS
368if HW_LECROY_LOGICSTUDIO
369libsigrok_la_SOURCES += \
370 src/hardware/lecroy-logicstudio/protocol.h \
371 src/hardware/lecroy-logicstudio/protocol.c \
372 src/hardware/lecroy-logicstudio/api.c
373endif
8f4e922f
UH
374if HW_MANSON_HCS_3XXX
375libsigrok_la_SOURCES += \
155b680d
BV
376 src/hardware/manson-hcs-3xxx/protocol.h \
377 src/hardware/manson-hcs-3xxx/protocol.c \
378 src/hardware/manson-hcs-3xxx/api.c
8f4e922f 379endif
e1ccfb19
AJ
380if HW_MAYNUO_M97
381libsigrok_la_SOURCES += \
382 src/hardware/maynuo-m97/protocol.h \
383 src/hardware/maynuo-m97/protocol.c \
384 src/hardware/maynuo-m97/api.c
385endif
67bd8055
UH
386if HW_MIC_985XX
387libsigrok_la_SOURCES += \
155b680d
BV
388 src/hardware/mic-985xx/protocol.h \
389 src/hardware/mic-985xx/protocol.c \
390 src/hardware/mic-985xx/api.c
67bd8055 391endif
41b7bd01
MH
392if HW_MOTECH_LPS_30X
393libsigrok_la_SOURCES += \
155b680d
BV
394 src/hardware/motech-lps-30x/protocol.h \
395 src/hardware/motech-lps-30x/protocol.c \
396 src/hardware/motech-lps-30x/api.c
41b7bd01 397endif
67bd8055
UH
398if HW_NORMA_DMM
399libsigrok_la_SOURCES += \
155b680d
BV
400 src/hardware/norma-dmm/protocol.h \
401 src/hardware/norma-dmm/protocol.c \
402 src/hardware/norma-dmm/api.c
67bd8055 403endif
d4b38748 404if HW_OPENBENCH_LOGIC_SNIFFER
67bd8055 405libsigrok_la_SOURCES += \
155b680d
BV
406 src/hardware/openbench-logic-sniffer/protocol.h \
407 src/hardware/openbench-logic-sniffer/protocol.c \
408 src/hardware/openbench-logic-sniffer/api.c
67bd8055 409endif
4bd80e12 410if HW_PIPISTRELLO_OLS
411libsigrok_la_SOURCES += \
412 src/hardware/pipistrello-ols/protocol.h \
413 src/hardware/pipistrello-ols/protocol.c \
414 src/hardware/pipistrello-ols/api.c
415endif
67bd8055
UH
416if HW_RIGOL_DS
417libsigrok_la_SOURCES += \
155b680d
BV
418 src/hardware/rigol-ds/protocol.h \
419 src/hardware/rigol-ds/protocol.c \
420 src/hardware/rigol-ds/api.c
67bd8055
UH
421endif
422if HW_SALEAE_LOGIC16
423libsigrok_la_SOURCES += \
155b680d
BV
424 src/hardware/saleae-logic16/protocol.h \
425 src/hardware/saleae-logic16/protocol.c \
426 src/hardware/saleae-logic16/api.c
67bd8055 427endif
ca1a7cb5
BV
428if HW_SCPI_PPS
429libsigrok_la_SOURCES += \
430 src/hardware/scpi-pps/protocol.h \
431 src/hardware/scpi-pps/protocol.c \
d4eabea8 432 src/hardware/scpi-pps/profiles.c \
ca1a7cb5
BV
433 src/hardware/scpi-pps/api.c
434endif
67bd8055
UH
435if HW_SERIAL_DMM
436libsigrok_la_SOURCES += \
155b680d
BV
437 src/hardware/serial-dmm/protocol.h \
438 src/hardware/serial-dmm/protocol.c \
439 src/hardware/serial-dmm/api.c
67bd8055
UH
440endif
441if HW_SYSCLK_LWLA
442libsigrok_la_SOURCES += \
155b680d
BV
443 src/hardware/sysclk-lwla/lwla.h \
444 src/hardware/sysclk-lwla/lwla.c \
be64f90b
DE
445 src/hardware/sysclk-lwla/lwla1016.c \
446 src/hardware/sysclk-lwla/lwla1034.c \
155b680d
BV
447 src/hardware/sysclk-lwla/protocol.h \
448 src/hardware/sysclk-lwla/protocol.c \
449 src/hardware/sysclk-lwla/api.c
67bd8055
UH
450endif
451if HW_TELEINFO
452libsigrok_la_SOURCES += \
155b680d
BV
453 src/hardware/teleinfo/protocol.h \
454 src/hardware/teleinfo/protocol.c \
455 src/hardware/teleinfo/api.c
67bd8055 456endif
0acdd793
BV
457if HW_TESTO
458libsigrok_la_SOURCES += \
155b680d
BV
459 src/hardware/testo/protocol.h \
460 src/hardware/testo/protocol.c \
461 src/hardware/testo/api.c
0acdd793 462endif
67bd8055
UH
463if HW_TONDAJ_SL_814
464libsigrok_la_SOURCES += \
155b680d
BV
465 src/hardware/tondaj-sl-814/protocol.h \
466 src/hardware/tondaj-sl-814/protocol.c \
467 src/hardware/tondaj-sl-814/api.c
67bd8055
UH
468endif
469if HW_UNI_T_DMM
470libsigrok_la_SOURCES += \
155b680d
BV
471 src/hardware/uni-t-dmm/protocol.h \
472 src/hardware/uni-t-dmm/protocol.c \
473 src/hardware/uni-t-dmm/api.c
67bd8055
UH
474endif
475if HW_UNI_T_UT32X
476libsigrok_la_SOURCES += \
155b680d
BV
477 src/hardware/uni-t-ut32x/protocol.h \
478 src/hardware/uni-t-ut32x/protocol.c \
479 src/hardware/uni-t-ut32x/api.c
67bd8055
UH
480endif
481if HW_VICTOR_DMM
482libsigrok_la_SOURCES += \
155b680d
BV
483 src/hardware/victor-dmm/protocol.h \
484 src/hardware/victor-dmm/protocol.c \
485 src/hardware/victor-dmm/api.c
67bd8055 486endif
10763937
SA
487if HW_YOKOGAWA_DLM
488libsigrok_la_SOURCES += \
489 src/hardware/yokogawa-dlm/protocol.h \
490 src/hardware/yokogawa-dlm/protocol.c \
491 src/hardware/yokogawa-dlm/protocol_wrappers.h \
492 src/hardware/yokogawa-dlm/protocol_wrappers.c \
493 src/hardware/yokogawa-dlm/api.c
494endif
67bd8055
UH
495if HW_ZEROPLUS_LOGIC_CUBE
496libsigrok_la_SOURCES += \
155b680d
BV
497 src/hardware/zeroplus-logic-cube/analyzer.c \
498 src/hardware/zeroplus-logic-cube/analyzer.h \
499 src/hardware/zeroplus-logic-cube/gl_usb.h \
500 src/hardware/zeroplus-logic-cube/gl_usb.c \
501 src/hardware/zeroplus-logic-cube/protocol.h \
502 src/hardware/zeroplus-logic-cube/protocol.c \
503 src/hardware/zeroplus-logic-cube/api.c
67bd8055
UH
504endif
505
dd5c48a6
LPC
506# This entry must be placed after all drivers
507libsigrok_la_SOURCES += src/hardware/driver_list_end.c
508
bc8ff24d 509libsigrok_la_LIBADD = $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
1f61c22f 510libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
ff101fca 511
45c59c8b 512library_includedir = $(includedir)/libsigrok
63d0fb75
ML
513library_include_HEADERS = \
514 include/libsigrok/libsigrok.h \
122322a9
DE
515 include/libsigrok/proto.h
516nodist_library_include_HEADERS = \
63d0fb75 517 include/libsigrok/version.h
155b680d 518noinst_HEADERS = src/libsigrok-internal.h
a1bb33af 519
8a7b47cd
UH
520pkgconfigdir = $(libdir)/pkgconfig
521pkgconfig_DATA = libsigrok.pc
d658e348 522
67bd8055
UH
523EXTRA_DIST = \
524 Doxyfile \
525 HACKING \
526 README.devices \
31ac7735
DE
527 bindings/cxx/ConfigKey_methods.cpp \
528 bindings/cxx/ConfigKey_methods.hpp \
529 bindings/cxx/ConfigKey_methods.i \
530 bindings/cxx/Doxyfile \
531 bindings/cxx/QuantityFlag_methods.cpp \
532 bindings/cxx/QuantityFlag_methods.hpp \
533 bindings/cxx/enums.py \
534 bindings/python/Doxyfile \
535 bindings/python/setup.py \
536 bindings/python/sigrok/__init__.py \
537 bindings/python/sigrok/core/__init__.py \
538 bindings/python/sigrok/core/classes.i \
c4a1015a 539 bindings/ruby/classes.i \
31ac7735
DE
540 bindings/java/Doxyfile \
541 bindings/java/org/sigrok/core/classes/classes.i \
542 bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
543 bindings/java/org/sigrok/core/interfaces/LogCallback.java \
31ac7735
DE
544 bindings/swig/classes.i \
545 bindings/swig/doc.py \
0a9d05dc 546 bindings/swig/templates.i \
67bd8055
UH
547 contrib/gnuplot_chronovu_la8.gpi \
548 contrib/gnuplot_rigol_ds1xx2.gpi \
549 contrib/gnuplot_usbeesx.gpi \
550 contrib/gnuplot_usbeedx8.gpi \
551 contrib/gnuplot_usbeedx16.gpi \
552 contrib/sigrok-logo-notext.png \
553 contrib/z60_libsigrok.rules
554
555if HAVE_CHECK
02a2bf68 556TESTS = tests/main
67bd8055 557check_PROGRAMS = ${TESTS}
65489c1a 558endif
67bd8055 559
02a2bf68 560tests_main_SOURCES = \
6592c369 561 include/libsigrok/libsigrok.h \
67bd8055
UH
562 tests/lib.c \
563 tests/lib.h \
02a2bf68
UH
564 tests/main.c \
565 tests/core.c \
566 tests/input_all.c \
567 tests/input_binary.c \
568 tests/output_all.c \
569 tests/transform_all.c \
570 tests/session.c \
571 tests/strutil.c \
572 tests/version.c \
573 tests/driver_all.c \
574 tests/device.c \
6b71bf1b
UH
575 tests/trigger.c \
576 tests/analog.c
02a2bf68 577
65489c1a 578tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
dd8b5f56 579
580ed400
ML
580BUILD_EXTRA =
581INSTALL_EXTRA =
7252a09e 582UNINSTALL_EXTRA =
580ed400
ML
583CLEAN_EXTRA =
584
c23c8659
ML
585if BINDINGS_CXX
586
52ff4f6a 587lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
c23c8659 588
52ff4f6a 589bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
c23c8659 590
bc8ff24d 591bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
1f61c22f 592bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
fc8f82e9 593
0959ed3d
UH
594bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
595bindings_cxx_libsigrokcxx_la_include_HEADERS = \
122322a9
DE
596 bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
597nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
161dc24d 598 bindings/cxx/include/libsigrokcxx/enums.hpp
c23c8659 599
52ff4f6a 600pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
c23c8659 601
3532ed01 602doxy/xml/index.xml: include/libsigrok/libsigrok.h
7f82ec4d 603 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
580ed400 604
cf5b338e 605bindings/swig/enums.i: bindings/cxx/enums.timestamp
580ed400 606bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
161dc24d 607bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
c23c8659 608
b595a458 609bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
c23c8659 610 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
b595a458 611 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
f2a189f0 612 $(AM_V_at)touch $@
c23c8659 613
580ed400 614bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
cf5b338e 615 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
c23c8659 616
580ed400 617cxx-clean:
3532ed01 618 rm -rf doxy/
bd4fda24 619 rm -rf bindings/cxx/doxy/
45ec8f77 620 rm -f bindings/swig/enums.i
580ed400 621 rm -f bindings/cxx/enums.cpp
161dc24d 622 rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
580ed400 623 rm -f bindings/cxx/enums.timestamp
c23c8659 624
580ed400
ML
625CLEAN_EXTRA += cxx-clean
626
627endif
f7740954 628
bd4fda24
ML
629CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
630
161dc24d 631$(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
bd4fda24 632 bindings/cxx/enums.timestamp
33c84e81 633 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
bd4fda24 634
8ebf1469
DE
635# Macro definitions to be used by the SWIG parser.
636swig_defs = -Dnoexcept= -Dprivate=protected -DG_GNUC_BEGIN_IGNORE_DEPRECATIONS= -DG_GNUC_END_IGNORE_DEPRECATIONS=
637
f7740954
ML
638if BINDINGS_PYTHON
639
d1785122 640PDIR = bindings/python
df979d6d
ML
641PDOC_START = bindings/python/sigrok/core/doc_start.i
642PDOC_END = bindings/python/sigrok/core/doc_end.i
bd4fda24 643
0441038e 644setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' CXXFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' LDADD='$(PYSIGROK_LIBS)'
c05a0ba5
DE
645setup_quiet = --quiet
646setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
a9cb82ac 647
df979d6d 648$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
f3256bb7 649 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
df979d6d
ML
650 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
651
652$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
653 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
654 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
d1785122
ML
655
656python-build: $(PDIR)/timestamp
657
fd31865e 658$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
36e3f6a9
ML
659 bindings/swig/classes.i bindings/swig/templates.i \
660 bindings/swig/enums.i $(PDOC_START) $(PDOC_END) \
661 $(library_include_HEADERS) \
df979d6d 662 $(nodist_library_include_HEADERS) \
fd31865e
ML
663 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
664 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
ba3070ff 665 @ORDER@ bindings/cxx/libsigrokcxx.la
a9cb82ac 666 $(AM_V_at)$(setup_py) clean --all 2>/dev/null
8ebf1469 667 $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" --swig-opts '$(swig_defs)' build_py
a9cb82ac 668 $(AM_V_at): >$@
f7740954 669
a9cb82ac
DE
670python-install:
671 $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
452986be
DE
672 destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
673 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
f7740954 674
c26162ff 675python-clean:
a9cb82ac
DE
676 -$(AM_V_at)rm -f $(PDIR)/timestamp
677 -$(AM_V_at)rm -fr $(PDIR)/doxy
c05a0ba5 678 -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
6a8c1d68
ML
679
680python-doc:
a9cb82ac 681 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
f7740954
ML
682
683BUILD_EXTRA += python-build
684INSTALL_EXTRA += python-install
685CLEAN_EXTRA += python-clean
686
687endif
688
27d44cf6
AJ
689if BINDINGS_RUBY
690
691RDIR = bindings/ruby
692RDOC = $(RDIR)/doc.i
693RWRAP = $(RDIR)/classes_wrap.cpp
694ROBJ = $(RWRAP:.cpp=.o)
e9227902 695REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
27d44cf6
AJ
696
697$(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
17165513 698 $(AM_V_at)test -d $(RDIR) || $(MKDIR_P) $(RDIR)
27d44cf6
AJ
699 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
700
701$(RWRAP): $(RDIR)/classes.i $(RDOC) \
702 bindings/swig/classes.i bindings/swig/templates.i \
703 bindings/swig/enums.i
17165513 704 $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include -I$(RDIR) $(local_includes) $(swig_defs) -o $@ $<
27d44cf6
AJ
705
706$(ROBJ): $(RWRAP) \
707 $(library_include_HEADERS) \
708 $(nodist_library_include_HEADERS) \
709 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
710 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
17165513 711 $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include $(local_includes) -fPIC -o $@ -c $<
27d44cf6
AJ
712
713$(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
b571f84c 714 $(AM_V_CXXLD)$(CXX) -shared -o $@ $< -lsigrokcxx -Lbindings/cxx/.libs $(RBSIGROK_LIBS)
27d44cf6
AJ
715
716ruby-build: $(REXT)
717
718ruby-install: $(REXT)
e9227902
AJ
719 $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
720 $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
27d44cf6 721
c4a1015a
MS
722ruby-uninstall:
723 rm -f $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)/sigrok.$(RUBY_DLEXT)
724
27d44cf6
AJ
725ruby-clean:
726 -$(AM_V_at)rm -fr $(RDIR)/doc
17165513 727 -$(AM_V_at)rm -f $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
27d44cf6
AJ
728
729ruby-doc: $(RWRAP)
730 $(AM_V_at)yard doc -o $(RDIR)/doc $<
731
732BUILD_EXTRA += ruby-build
733INSTALL_EXTRA += ruby-install
c4a1015a 734UNINSTALL_EXTRA += ruby-uninstall
27d44cf6
AJ
735CLEAN_EXTRA += ruby-clean
736
737endif
738
9fcf4d0b
ML
739if BINDINGS_JAVA
740
741JDIR = bindings/java
90bd7656
ML
742JPKG = org/sigrok/core
743JCLS = $(JDIR)/$(JPKG)/classes
744JINT = $(JDIR)/$(JPKG)/interfaces
33c84e81 745JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
90bd7656 746JSWG = $(JCLS)/classes.i
bd4fda24 747JDOC = $(JCLS)/doc.i
90bd7656 748JCXX = $(JCLS)/classes_wrap.cxx
9fcf4d0b
ML
749JLIB = $(JDIR)/libsigrok_java_core_classes.so
750JJAR = $(JDIR)/sigrok-core.jar
751
a9cb82ac
DE
752java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
753
9fcf4d0b
ML
754java-build: $(JJAR) $(JLIB)
755
dbde3b65 756$(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
f3256bb7 757 $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
dbde3b65 758 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
bd4fda24 759
36e3f6a9
ML
760$(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i \
761 bindings/swig/templates.i bindings/swig/enums.i \
fd31865e
ML
762 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
763 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
a9cb82ac 764 -$(AM_V_at)rm -f $(java_cleanfiles)
8ebf1469 765 $(AM_V_GEN)$(SWIG) -c++ $(swig_defs) \
4c9208a7 766 -java -package org.sigrok.core.classes \
dbde3b65
DE
767 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
768 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
9fcf4d0b 769
90bd7656 770$(JJAR): $(JCXX)
1f61c22f 771 $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
f2a189f0 772 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
9fcf4d0b 773
fd31865e
ML
774$(JLIB): $(JCXX) \
775 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
776 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
777 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
ba3070ff 778 @ORDER@ bindings/cxx/libsigrokcxx.la
1f61c22f 779 $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
90bd7656 780 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
1f61c22f 781 -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
9fcf4d0b
ML
782
783java-install:
df705a7a 784 $(INSTALL) -d $(DESTDIR)$(libdir)/jni
8e0f9bf7 785 $(INSTALL) $(JLIB) $(DESTDIR)$(libdir)/jni
df705a7a 786 $(INSTALL) -d $(DESTDIR)$(datadir)/java
8e0f9bf7 787 $(INSTALL) $(JJAR) $(DESTDIR)$(datadir)/java
9fcf4d0b 788
7252a09e
DE
789java-uninstall:
790 -rm -f $(DESTDIR)$(datadir)/java/sigrok-core.jar
791 -rm -f $(DESTDIR)$(libdir)/jni/libsigrok_java_core_classes.so
792
9fcf4d0b 793java-clean:
45ec8f77 794 -$(AM_V_at)rm -f $(java_cleanfiles) $(JDOC)
a9cb82ac 795 -$(AM_V_at)rm -fr $(JDIR)/doxy
8a314e90
ML
796
797java-doc:
a9cb82ac 798 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
9fcf4d0b
ML
799
800BUILD_EXTRA += java-build
801INSTALL_EXTRA += java-install
7252a09e 802UNINSTALL_EXTRA += java-uninstall
9fcf4d0b
ML
803CLEAN_EXTRA += java-clean
804
805endif
806
f7740954
ML
807all-local: $(BUILD_EXTRA)
808install-exec-local: $(INSTALL_EXTRA)
7252a09e 809uninstall-local: $(UNINSTALL_EXTRA)
d1785122 810clean-local: $(CLEAN_EXTRA)
f7740954 811
37829c15
DE
812.PHONY: dist-changelog
813
814dist-hook: dist-changelog
815
816dist-changelog:
817 $(AM_V_at)if test ! -d '$(top_srcdir)/.git'; then \
818 cp -f '$(top_srcdir)/ChangeLog' "$(top_distdir)/ChangeLog"; \
819 elif git -C '$(top_srcdir)' log >.ChangeLog.tmp; then \
820 mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
821 else \
822 rm -f .ChangeLog.tmp; exit 1; \
823 fi
0fc12d66 824