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