]> sigrok.org Git - libsigrok.git/blame_incremental - Makefile.am
Enable loading of session files without total probes defined
[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/drivers.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
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/gnuplot.c \
92 src/output/hex.c \
93 src/output/ols.c \
94 src/output/srzip.c \
95 src/output/vcd.c
96
97# Transform modules
98libsigrok_la_SOURCES += \
99 src/transform/transform.c \
100 src/transform/nop.c \
101 src/transform/scale.c \
102 src/transform/invert.c
103
104# SCPI support
105libsigrok_la_SOURCES += \
106 src/scpi.h \
107 src/scpi/scpi.c \
108 src/scpi/helpers.c \
109 src/scpi/scpi_tcp.c
110if NEED_RPC
111libsigrok_la_SOURCES += \
112 src/scpi/scpi_vxi.c \
113 src/scpi/vxi_clnt.c \
114 src/scpi/vxi_xdr.c \
115 src/scpi/vxi.h
116endif
117if NEED_SERIAL
118libsigrok_la_SOURCES += \
119 src/serial.c \
120 src/scpi/scpi_serial.c
121endif
122if NEED_USB
123libsigrok_la_SOURCES += \
124 src/ezusb.c \
125 src/usb.c \
126 src/scpi/scpi_usbtmc_libusb.c
127endif
128if NEED_VISA
129libsigrok_la_SOURCES += \
130 src/scpi/scpi_visa.c
131endif
132if NEED_GPIB
133libsigrok_la_SOURCES += \
134 src/scpi/scpi_libgpib.c
135endif
136
137# Modbus support
138libsigrok_la_SOURCES += \
139 src/modbus/modbus.c
140if NEED_SERIAL
141libsigrok_la_SOURCES += \
142 src/modbus/modbus_serial_rtu.c
143endif
144
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 \
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
170if HW_AGILENT_DMM
171libsigrok_la_SOURCES += \
172 src/hardware/agilent-dmm/api.c \
173 src/hardware/agilent-dmm/agilent-dmm.h \
174 src/hardware/agilent-dmm/sched.c
175endif
176if HW_APPA_55II
177libsigrok_la_SOURCES += \
178 src/hardware/appa-55ii/protocol.h \
179 src/hardware/appa-55ii/protocol.c \
180 src/hardware/appa-55ii/api.c
181endif
182if HW_ARACHNID_LABS_RE_LOAD_PRO
183libsigrok_la_SOURCES += \
184 src/hardware/arachnid-labs-re-load-pro/protocol.h \
185 src/hardware/arachnid-labs-re-load-pro/protocol.c \
186 src/hardware/arachnid-labs-re-load-pro/api.c
187endif
188if HW_ASIX_SIGMA
189libsigrok_la_SOURCES += \
190 src/hardware/asix-sigma/protocol.h \
191 src/hardware/asix-sigma/protocol.c \
192 src/hardware/asix-sigma/api.c
193endif
194if HW_ATTEN_PPS3XXX
195libsigrok_la_SOURCES += \
196 src/hardware/atten-pps3xxx/protocol.h \
197 src/hardware/atten-pps3xxx/protocol.c \
198 src/hardware/atten-pps3xxx/api.c
199endif
200if HW_BAYLIBRE_ACME
201libsigrok_la_SOURCES += \
202 src/hardware/baylibre-acme/protocol.h \
203 src/hardware/baylibre-acme/protocol.c \
204 src/hardware/baylibre-acme/api.c \
205 src/hardware/baylibre-acme/gpio.h \
206 src/hardware/baylibre-acme/gpio.c
207endif
208if HW_BEAGLELOGIC
209libsigrok_la_SOURCES += \
210 src/hardware/beaglelogic/beaglelogic.h \
211 src/hardware/beaglelogic/protocol.h \
212 src/hardware/beaglelogic/protocol.c \
213 src/hardware/beaglelogic/api.c
214endif
215if HW_BRYMEN_BM86X
216libsigrok_la_SOURCES += \
217 src/hardware/brymen-bm86x/protocol.h \
218 src/hardware/brymen-bm86x/protocol.c \
219 src/hardware/brymen-bm86x/api.c
220endif
221if HW_BRYMEN_DMM
222libsigrok_la_SOURCES += \
223 src/hardware/brymen-dmm/parser.c \
224 src/hardware/brymen-dmm/protocol.h \
225 src/hardware/brymen-dmm/protocol.c \
226 src/hardware/brymen-dmm/api.c
227endif
228if HW_CEM_DT_885X
229libsigrok_la_SOURCES += \
230 src/hardware/cem-dt-885x/protocol.h \
231 src/hardware/cem-dt-885x/protocol.c \
232 src/hardware/cem-dt-885x/api.c
233endif
234if HW_CENTER_3XX
235libsigrok_la_SOURCES += \
236 src/hardware/center-3xx/protocol.h \
237 src/hardware/center-3xx/protocol.c \
238 src/hardware/center-3xx/api.c
239endif
240if HW_CHRONOVU_LA
241libsigrok_la_SOURCES += \
242 src/hardware/chronovu-la/protocol.h \
243 src/hardware/chronovu-la/protocol.c \
244 src/hardware/chronovu-la/api.c
245endif
246if HW_COLEAD_SLM
247libsigrok_la_SOURCES += \
248 src/hardware/colead-slm/protocol.h \
249 src/hardware/colead-slm/protocol.c \
250 src/hardware/colead-slm/api.c
251endif
252if HW_CONRAD_DIGI_35_CPU
253libsigrok_la_SOURCES += \
254 src/hardware/conrad-digi-35-cpu/protocol.h \
255 src/hardware/conrad-digi-35-cpu/protocol.c \
256 src/hardware/conrad-digi-35-cpu/api.c
257endif
258if HW_DEMO
259libsigrok_la_SOURCES += \
260 src/hardware/demo/demo.c
261endif
262if HW_DEREE_DE5000
263libsigrok_la_SOURCES += \
264 src/hardware/deree-de5000/api.c
265endif
266if HW_FLUKE_DMM
267libsigrok_la_SOURCES += \
268 src/hardware/fluke-dmm/fluke-dmm.h \
269 src/hardware/fluke-dmm/fluke.c \
270 src/hardware/fluke-dmm/api.c
271endif
272if HW_FX2LAFW
273libsigrok_la_SOURCES += \
274 src/hardware/fx2lafw/protocol.h \
275 src/hardware/fx2lafw/protocol.c \
276 src/hardware/fx2lafw/api.c \
277 src/hardware/fx2lafw/dslogic.c \
278 src/hardware/fx2lafw/dslogic.h
279endif
280if HW_GMC_MH_1X_2X
281libsigrok_la_SOURCES += \
282 src/hardware/gmc-mh-1x-2x/protocol.h \
283 src/hardware/gmc-mh-1x-2x/protocol.c \
284 src/hardware/gmc-mh-1x-2x/api.c
285endif
286if HW_GWINSTEK_GDS_800
287libsigrok_la_SOURCES += \
288 src/hardware/gwinstek-gds-800/protocol.h \
289 src/hardware/gwinstek-gds-800/protocol.c \
290 src/hardware/gwinstek-gds-800/api.c
291endif
292if HW_HAMEG_HMO
293libsigrok_la_SOURCES += \
294 src/hardware/hameg-hmo/protocol.h \
295 src/hardware/hameg-hmo/protocol.c \
296 src/hardware/hameg-hmo/api.c
297endif
298if HW_HANTEK_6XXX
299libsigrok_la_SOURCES += \
300 src/hardware/hantek-6xxx/protocol.h \
301 src/hardware/hantek-6xxx/protocol.c \
302 src/hardware/hantek-6xxx/api.c
303endif
304if HW_HANTEK_DSO
305libsigrok_la_SOURCES += \
306 src/hardware/hantek-dso/dso.h \
307 src/hardware/hantek-dso/dso.c \
308 src/hardware/hantek-dso/api.c
309endif
310if HW_HUNG_CHANG_DSO_2100
311libsigrok_la_SOURCES += \
312 src/hardware/hung-chang-dso-2100/protocol.h \
313 src/hardware/hung-chang-dso-2100/protocol.c \
314 src/hardware/hung-chang-dso-2100/api.c
315endif
316if HW_IKALOGIC_SCANALOGIC2
317libsigrok_la_SOURCES += \
318 src/hardware/ikalogic-scanalogic2/protocol.h \
319 src/hardware/ikalogic-scanalogic2/protocol.c \
320 src/hardware/ikalogic-scanalogic2/api.c
321endif
322if HW_IKALOGIC_SCANAPLUS
323libsigrok_la_SOURCES += \
324 src/hardware/ikalogic-scanaplus/protocol.h \
325 src/hardware/ikalogic-scanaplus/protocol.c \
326 src/hardware/ikalogic-scanaplus/api.c
327endif
328if HW_KECHENG_KC_330B
329libsigrok_la_SOURCES += \
330 src/hardware/kecheng-kc-330b/protocol.h \
331 src/hardware/kecheng-kc-330b/protocol.c \
332 src/hardware/kecheng-kc-330b/api.c
333endif
334if HW_KERN_SCALE
335libsigrok_la_SOURCES += \
336 src/hardware/kern-scale/protocol.h \
337 src/hardware/kern-scale/protocol.c \
338 src/hardware/kern-scale/api.c
339endif
340if HW_KORAD_KAXXXXP
341libsigrok_la_SOURCES += \
342 src/hardware/korad-kaxxxxp/protocol.h \
343 src/hardware/korad-kaxxxxp/protocol.c \
344 src/hardware/korad-kaxxxxp/api.c
345endif
346if HW_LASCAR_EL_USB
347libsigrok_la_SOURCES += \
348 src/hardware/lascar-el-usb/protocol.h \
349 src/hardware/lascar-el-usb/protocol.c \
350 src/hardware/lascar-el-usb/api.c
351endif
352if HW_LECROY_LOGICSTUDIO
353libsigrok_la_SOURCES += \
354 src/hardware/lecroy-logicstudio/protocol.h \
355 src/hardware/lecroy-logicstudio/protocol.c \
356 src/hardware/lecroy-logicstudio/api.c
357endif
358if HW_MANSON_HCS_3XXX
359libsigrok_la_SOURCES += \
360 src/hardware/manson-hcs-3xxx/protocol.h \
361 src/hardware/manson-hcs-3xxx/protocol.c \
362 src/hardware/manson-hcs-3xxx/api.c
363endif
364if HW_MAYNUO_M97
365libsigrok_la_SOURCES += \
366 src/hardware/maynuo-m97/protocol.h \
367 src/hardware/maynuo-m97/protocol.c \
368 src/hardware/maynuo-m97/api.c
369endif
370if HW_MIC_985XX
371libsigrok_la_SOURCES += \
372 src/hardware/mic-985xx/protocol.h \
373 src/hardware/mic-985xx/protocol.c \
374 src/hardware/mic-985xx/api.c
375endif
376if HW_MOTECH_LPS_30X
377libsigrok_la_SOURCES += \
378 src/hardware/motech-lps-30x/protocol.h \
379 src/hardware/motech-lps-30x/protocol.c \
380 src/hardware/motech-lps-30x/api.c
381endif
382if HW_NORMA_DMM
383libsigrok_la_SOURCES += \
384 src/hardware/norma-dmm/protocol.h \
385 src/hardware/norma-dmm/protocol.c \
386 src/hardware/norma-dmm/api.c
387endif
388if HW_OPENBENCH_LOGIC_SNIFFER
389libsigrok_la_SOURCES += \
390 src/hardware/openbench-logic-sniffer/protocol.h \
391 src/hardware/openbench-logic-sniffer/protocol.c \
392 src/hardware/openbench-logic-sniffer/api.c
393endif
394if HW_PIPISTRELLO_OLS
395libsigrok_la_SOURCES += \
396 src/hardware/pipistrello-ols/protocol.h \
397 src/hardware/pipistrello-ols/protocol.c \
398 src/hardware/pipistrello-ols/api.c
399endif
400if HW_RIGOL_DS
401libsigrok_la_SOURCES += \
402 src/hardware/rigol-ds/protocol.h \
403 src/hardware/rigol-ds/protocol.c \
404 src/hardware/rigol-ds/api.c
405endif
406if HW_SALEAE_LOGIC16
407libsigrok_la_SOURCES += \
408 src/hardware/saleae-logic16/protocol.h \
409 src/hardware/saleae-logic16/protocol.c \
410 src/hardware/saleae-logic16/api.c
411endif
412if HW_SCPI_PPS
413libsigrok_la_SOURCES += \
414 src/hardware/scpi-pps/protocol.h \
415 src/hardware/scpi-pps/protocol.c \
416 src/hardware/scpi-pps/profiles.c \
417 src/hardware/scpi-pps/api.c
418endif
419if HW_SERIAL_DMM
420libsigrok_la_SOURCES += \
421 src/hardware/serial-dmm/protocol.h \
422 src/hardware/serial-dmm/protocol.c \
423 src/hardware/serial-dmm/api.c
424endif
425if HW_SYSCLK_LWLA
426libsigrok_la_SOURCES += \
427 src/hardware/sysclk-lwla/lwla.h \
428 src/hardware/sysclk-lwla/lwla.c \
429 src/hardware/sysclk-lwla/lwla1016.c \
430 src/hardware/sysclk-lwla/lwla1034.c \
431 src/hardware/sysclk-lwla/protocol.h \
432 src/hardware/sysclk-lwla/protocol.c \
433 src/hardware/sysclk-lwla/api.c
434endif
435if HW_TELEINFO
436libsigrok_la_SOURCES += \
437 src/hardware/teleinfo/protocol.h \
438 src/hardware/teleinfo/protocol.c \
439 src/hardware/teleinfo/api.c
440endif
441if HW_TESTO
442libsigrok_la_SOURCES += \
443 src/hardware/testo/protocol.h \
444 src/hardware/testo/protocol.c \
445 src/hardware/testo/api.c
446endif
447if HW_TONDAJ_SL_814
448libsigrok_la_SOURCES += \
449 src/hardware/tondaj-sl-814/protocol.h \
450 src/hardware/tondaj-sl-814/protocol.c \
451 src/hardware/tondaj-sl-814/api.c
452endif
453if HW_UNI_T_DMM
454libsigrok_la_SOURCES += \
455 src/hardware/uni-t-dmm/protocol.h \
456 src/hardware/uni-t-dmm/protocol.c \
457 src/hardware/uni-t-dmm/api.c
458endif
459if HW_UNI_T_UT32X
460libsigrok_la_SOURCES += \
461 src/hardware/uni-t-ut32x/protocol.h \
462 src/hardware/uni-t-ut32x/protocol.c \
463 src/hardware/uni-t-ut32x/api.c
464endif
465if HW_VICTOR_DMM
466libsigrok_la_SOURCES += \
467 src/hardware/victor-dmm/protocol.h \
468 src/hardware/victor-dmm/protocol.c \
469 src/hardware/victor-dmm/api.c
470endif
471if HW_YOKOGAWA_DLM
472libsigrok_la_SOURCES += \
473 src/hardware/yokogawa-dlm/protocol.h \
474 src/hardware/yokogawa-dlm/protocol.c \
475 src/hardware/yokogawa-dlm/protocol_wrappers.h \
476 src/hardware/yokogawa-dlm/protocol_wrappers.c \
477 src/hardware/yokogawa-dlm/api.c
478endif
479if HW_ZEROPLUS_LOGIC_CUBE
480libsigrok_la_SOURCES += \
481 src/hardware/zeroplus-logic-cube/analyzer.c \
482 src/hardware/zeroplus-logic-cube/analyzer.h \
483 src/hardware/zeroplus-logic-cube/gl_usb.h \
484 src/hardware/zeroplus-logic-cube/gl_usb.c \
485 src/hardware/zeroplus-logic-cube/protocol.h \
486 src/hardware/zeroplus-logic-cube/protocol.c \
487 src/hardware/zeroplus-logic-cube/api.c
488endif
489
490libsigrok_la_LIBADD = $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
491libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
492
493library_includedir = $(includedir)/libsigrok
494library_include_HEADERS = \
495 include/libsigrok/libsigrok.h \
496 include/libsigrok/proto.h
497nodist_library_include_HEADERS = \
498 include/libsigrok/version.h
499noinst_HEADERS = src/libsigrok-internal.h
500
501pkgconfigdir = $(libdir)/pkgconfig
502pkgconfig_DATA = libsigrok.pc
503
504EXTRA_DIST = \
505 Doxyfile \
506 HACKING \
507 README.devices \
508 bindings/cxx/ConfigKey_methods.cpp \
509 bindings/cxx/ConfigKey_methods.hpp \
510 bindings/cxx/ConfigKey_methods.i \
511 bindings/cxx/Doxyfile \
512 bindings/cxx/QuantityFlag_methods.cpp \
513 bindings/cxx/QuantityFlag_methods.hpp \
514 bindings/cxx/enums.py \
515 bindings/python/Doxyfile \
516 bindings/python/setup.py \
517 bindings/python/sigrok/__init__.py \
518 bindings/python/sigrok/core/__init__.py \
519 bindings/python/sigrok/core/classes.i \
520 bindings/java/Doxyfile \
521 bindings/java/org/sigrok/core/classes/classes.i \
522 bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
523 bindings/java/org/sigrok/core/interfaces/LogCallback.java \
524 bindings/swig/classes.i \
525 bindings/swig/doc.py \
526 bindings/swig/templates.i \
527 contrib/gnuplot_chronovu_la8.gpi \
528 contrib/gnuplot_rigol_ds1xx2.gpi \
529 contrib/gnuplot_usbeesx.gpi \
530 contrib/gnuplot_usbeedx8.gpi \
531 contrib/gnuplot_usbeedx16.gpi \
532 contrib/sigrok-logo-notext.png \
533 contrib/z60_libsigrok.rules
534
535if HAVE_CHECK
536TESTS = tests/main
537check_PROGRAMS = ${TESTS}
538endif
539
540tests_main_SOURCES = \
541 include/libsigrok/libsigrok.h \
542 tests/lib.c \
543 tests/lib.h \
544 tests/main.c \
545 tests/core.c \
546 tests/input_all.c \
547 tests/input_binary.c \
548 tests/output_all.c \
549 tests/transform_all.c \
550 tests/session.c \
551 tests/strutil.c \
552 tests/version.c \
553 tests/driver_all.c \
554 tests/device.c \
555 tests/trigger.c \
556 tests/analog.c
557
558tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
559
560BUILD_EXTRA =
561INSTALL_EXTRA =
562UNINSTALL_EXTRA =
563CLEAN_EXTRA =
564
565if BINDINGS_CXX
566
567lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
568
569bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
570
571bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
572bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
573
574bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
575bindings_cxx_libsigrokcxx_la_include_HEADERS = \
576 bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
577nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
578 bindings/cxx/include/libsigrokcxx/enums.hpp
579
580pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
581
582doxy/xml/index.xml: include/libsigrok/libsigrok.h
583 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
584
585bindings/swig/enums.i: bindings/cxx/enums.timestamp
586bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
587bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
588
589bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
590 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
591 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
592 $(AM_V_at)touch $@
593
594bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
595 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
596
597cxx-clean:
598 rm -rf doxy/
599 rm -rf bindings/cxx/doxy/
600 rm -f bindings/swig/enums.i
601 rm -f bindings/cxx/enums.cpp
602 rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
603 rm -f bindings/cxx/enums.timestamp
604
605CLEAN_EXTRA += cxx-clean
606
607endif
608
609CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
610
611$(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
612 bindings/cxx/enums.timestamp
613 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
614
615# Macro definitions to be used by the SWIG parser.
616swig_defs = -Dnoexcept= -Dprivate=protected -DG_GNUC_BEGIN_IGNORE_DEPRECATIONS= -DG_GNUC_END_IGNORE_DEPRECATIONS=
617
618if BINDINGS_PYTHON
619
620PDIR = bindings/python
621PDOC_START = bindings/python/sigrok/core/doc_start.i
622PDOC_END = bindings/python/sigrok/core/doc_end.i
623
624setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' CXXFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' LDADD='$(PYSIGROK_LIBS)'
625setup_quiet = --quiet
626setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
627
628$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
629 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
630 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
631
632$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
633 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
634 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
635
636python-build: $(PDIR)/timestamp
637
638$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
639 bindings/swig/classes.i bindings/swig/templates.i \
640 bindings/swig/enums.i $(PDOC_START) $(PDOC_END) \
641 $(library_include_HEADERS) \
642 $(nodist_library_include_HEADERS) \
643 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
644 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
645 @ORDER@ bindings/cxx/libsigrokcxx.la
646 $(AM_V_at)$(setup_py) clean --all 2>/dev/null
647 $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" --swig-opts '$(swig_defs)' build_py
648 $(AM_V_at): >$@
649
650python-install:
651 $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
652 destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
653 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
654
655python-clean:
656 -$(AM_V_at)rm -f $(PDIR)/timestamp
657 -$(AM_V_at)rm -fr $(PDIR)/doxy
658 -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
659
660python-doc:
661 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
662
663BUILD_EXTRA += python-build
664INSTALL_EXTRA += python-install
665CLEAN_EXTRA += python-clean
666
667endif
668
669if BINDINGS_RUBY
670
671RDIR = bindings/ruby
672RDOC = $(RDIR)/doc.i
673RWRAP = $(RDIR)/classes_wrap.cpp
674ROBJ = $(RWRAP:.cpp=.o)
675REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
676
677$(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
678 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
679
680$(RWRAP): $(RDIR)/classes.i $(RDOC) \
681 bindings/swig/classes.i bindings/swig/templates.i \
682 bindings/swig/enums.i
683 $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include $(swig_defs) -o $@ $<
684
685$(ROBJ): $(RWRAP) \
686 $(library_include_HEADERS) \
687 $(nodist_library_include_HEADERS) \
688 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
689 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
690 $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include -fPIC -o $@ -c $<
691
692$(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
693 $(AM_V_CXXLD)$(CXX) -shared -std=c++11 -o $@ $< -lsigrokcxx -Lbindings/cxx/.libs $(RBSIGROK_LIBS)
694
695ruby-build: $(REXT)
696
697ruby-install: $(REXT)
698 $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
699 $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
700
701ruby-clean:
702 -$(AM_V_at)rm -fr $(RDIR)/doc
703 -$(AM_V_at)rm $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
704
705ruby-doc: $(RWRAP)
706 $(AM_V_at)yard doc -o $(RDIR)/doc $<
707
708BUILD_EXTRA += ruby-build
709INSTALL_EXTRA += ruby-install
710CLEAN_EXTRA += ruby-clean
711
712endif
713
714if BINDINGS_JAVA
715
716JDIR = bindings/java
717JPKG = org/sigrok/core
718JCLS = $(JDIR)/$(JPKG)/classes
719JINT = $(JDIR)/$(JPKG)/interfaces
720JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
721JSWG = $(JCLS)/classes.i
722JDOC = $(JCLS)/doc.i
723JCXX = $(JCLS)/classes_wrap.cxx
724JLIB = $(JDIR)/libsigrok_java_core_classes.so
725JJAR = $(JDIR)/sigrok-core.jar
726
727java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
728
729java-build: $(JJAR) $(JLIB)
730
731$(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
732 $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
733 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
734
735$(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i \
736 bindings/swig/templates.i bindings/swig/enums.i \
737 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
738 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
739 -$(AM_V_at)rm -f $(java_cleanfiles)
740 $(AM_V_GEN)$(SWIG) -c++ $(swig_defs) \
741 -java -package org.sigrok.core.classes \
742 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
743 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
744
745$(JJAR): $(JCXX)
746 $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
747 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
748
749$(JLIB): $(JCXX) \
750 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
751 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
752 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
753 @ORDER@ bindings/cxx/libsigrokcxx.la
754 $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
755 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
756 -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
757
758java-install:
759 $(INSTALL) -d $(DESTDIR)$(libdir)/jni
760 $(INSTALL) $(JLIB) $(DESTDIR)$(libdir)/jni
761 $(INSTALL) -d $(DESTDIR)$(datadir)/java
762 $(INSTALL) $(JJAR) $(DESTDIR)$(datadir)/java
763
764java-uninstall:
765 -rm -f $(DESTDIR)$(datadir)/java/sigrok-core.jar
766 -rm -f $(DESTDIR)$(libdir)/jni/libsigrok_java_core_classes.so
767
768java-clean:
769 -$(AM_V_at)rm -f $(java_cleanfiles) $(JDOC)
770 -$(AM_V_at)rm -fr $(JDIR)/doxy
771
772java-doc:
773 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
774
775BUILD_EXTRA += java-build
776INSTALL_EXTRA += java-install
777UNINSTALL_EXTRA += java-uninstall
778CLEAN_EXTRA += java-clean
779
780endif
781
782all-local: $(BUILD_EXTRA)
783install-exec-local: $(INSTALL_EXTRA)
784uninstall-local: $(UNINSTALL_EXTRA)
785clean-local: $(CLEAN_EXTRA)
786
787.PHONY: dist-changelog
788
789dist-hook: dist-changelog
790
791dist-changelog:
792 $(AM_V_at)if test ! -d '$(top_srcdir)/.git'; then \
793 cp -f '$(top_srcdir)/ChangeLog' "$(top_distdir)/ChangeLog"; \
794 elif git -C '$(top_srcdir)' log >.ChangeLog.tmp; then \
795 mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
796 else \
797 rm -f .ChangeLog.tmp; exit 1; \
798 fi
799