]> sigrok.org Git - libsigrok.git/blame_incremental - Makefile.am
ft2232h: Add support for FTDI FT2232H/FT232R chip as LA.
[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_FT2232H
273libsigrok_la_SOURCES += \
274 src/hardware/ft2232h/protocol.h \
275 src/hardware/ft2232h/protocol.c \
276 src/hardware/ft2232h/api.c
277endif
278if HW_FX2LAFW
279libsigrok_la_SOURCES += \
280 src/hardware/fx2lafw/protocol.h \
281 src/hardware/fx2lafw/protocol.c \
282 src/hardware/fx2lafw/api.c \
283 src/hardware/fx2lafw/dslogic.c \
284 src/hardware/fx2lafw/dslogic.h
285endif
286if HW_GMC_MH_1X_2X
287libsigrok_la_SOURCES += \
288 src/hardware/gmc-mh-1x-2x/protocol.h \
289 src/hardware/gmc-mh-1x-2x/protocol.c \
290 src/hardware/gmc-mh-1x-2x/api.c
291endif
292if HW_GWINSTEK_GDS_800
293libsigrok_la_SOURCES += \
294 src/hardware/gwinstek-gds-800/protocol.h \
295 src/hardware/gwinstek-gds-800/protocol.c \
296 src/hardware/gwinstek-gds-800/api.c
297endif
298if HW_HAMEG_HMO
299libsigrok_la_SOURCES += \
300 src/hardware/hameg-hmo/protocol.h \
301 src/hardware/hameg-hmo/protocol.c \
302 src/hardware/hameg-hmo/api.c
303endif
304if HW_HANTEK_6XXX
305libsigrok_la_SOURCES += \
306 src/hardware/hantek-6xxx/protocol.h \
307 src/hardware/hantek-6xxx/protocol.c \
308 src/hardware/hantek-6xxx/api.c
309endif
310if HW_HANTEK_DSO
311libsigrok_la_SOURCES += \
312 src/hardware/hantek-dso/dso.h \
313 src/hardware/hantek-dso/dso.c \
314 src/hardware/hantek-dso/api.c
315endif
316if HW_HP_3457A
317libsigrok_la_SOURCES += \
318 src/hardware/hp-3457a/protocol.h \
319 src/hardware/hp-3457a/protocol.c \
320 src/hardware/hp-3457a/api.c
321endif
322if HW_HUNG_CHANG_DSO_2100
323libsigrok_la_SOURCES += \
324 src/hardware/hung-chang-dso-2100/protocol.h \
325 src/hardware/hung-chang-dso-2100/protocol.c \
326 src/hardware/hung-chang-dso-2100/api.c
327endif
328if HW_IKALOGIC_SCANALOGIC2
329libsigrok_la_SOURCES += \
330 src/hardware/ikalogic-scanalogic2/protocol.h \
331 src/hardware/ikalogic-scanalogic2/protocol.c \
332 src/hardware/ikalogic-scanalogic2/api.c
333endif
334if HW_IKALOGIC_SCANAPLUS
335libsigrok_la_SOURCES += \
336 src/hardware/ikalogic-scanaplus/protocol.h \
337 src/hardware/ikalogic-scanaplus/protocol.c \
338 src/hardware/ikalogic-scanaplus/api.c
339endif
340if HW_KECHENG_KC_330B
341libsigrok_la_SOURCES += \
342 src/hardware/kecheng-kc-330b/protocol.h \
343 src/hardware/kecheng-kc-330b/protocol.c \
344 src/hardware/kecheng-kc-330b/api.c
345endif
346if HW_KERN_SCALE
347libsigrok_la_SOURCES += \
348 src/hardware/kern-scale/protocol.h \
349 src/hardware/kern-scale/protocol.c \
350 src/hardware/kern-scale/api.c
351endif
352if HW_KORAD_KAXXXXP
353libsigrok_la_SOURCES += \
354 src/hardware/korad-kaxxxxp/protocol.h \
355 src/hardware/korad-kaxxxxp/protocol.c \
356 src/hardware/korad-kaxxxxp/api.c
357endif
358if HW_LASCAR_EL_USB
359libsigrok_la_SOURCES += \
360 src/hardware/lascar-el-usb/protocol.h \
361 src/hardware/lascar-el-usb/protocol.c \
362 src/hardware/lascar-el-usb/api.c
363endif
364if HW_LECROY_LOGICSTUDIO
365libsigrok_la_SOURCES += \
366 src/hardware/lecroy-logicstudio/protocol.h \
367 src/hardware/lecroy-logicstudio/protocol.c \
368 src/hardware/lecroy-logicstudio/api.c
369endif
370if HW_MANSON_HCS_3XXX
371libsigrok_la_SOURCES += \
372 src/hardware/manson-hcs-3xxx/protocol.h \
373 src/hardware/manson-hcs-3xxx/protocol.c \
374 src/hardware/manson-hcs-3xxx/api.c
375endif
376if HW_MAYNUO_M97
377libsigrok_la_SOURCES += \
378 src/hardware/maynuo-m97/protocol.h \
379 src/hardware/maynuo-m97/protocol.c \
380 src/hardware/maynuo-m97/api.c
381endif
382if HW_MIC_985XX
383libsigrok_la_SOURCES += \
384 src/hardware/mic-985xx/protocol.h \
385 src/hardware/mic-985xx/protocol.c \
386 src/hardware/mic-985xx/api.c
387endif
388if HW_MOTECH_LPS_30X
389libsigrok_la_SOURCES += \
390 src/hardware/motech-lps-30x/protocol.h \
391 src/hardware/motech-lps-30x/protocol.c \
392 src/hardware/motech-lps-30x/api.c
393endif
394if HW_NORMA_DMM
395libsigrok_la_SOURCES += \
396 src/hardware/norma-dmm/protocol.h \
397 src/hardware/norma-dmm/protocol.c \
398 src/hardware/norma-dmm/api.c
399endif
400if HW_OPENBENCH_LOGIC_SNIFFER
401libsigrok_la_SOURCES += \
402 src/hardware/openbench-logic-sniffer/protocol.h \
403 src/hardware/openbench-logic-sniffer/protocol.c \
404 src/hardware/openbench-logic-sniffer/api.c
405endif
406if HW_PIPISTRELLO_OLS
407libsigrok_la_SOURCES += \
408 src/hardware/pipistrello-ols/protocol.h \
409 src/hardware/pipistrello-ols/protocol.c \
410 src/hardware/pipistrello-ols/api.c
411endif
412if HW_RIGOL_DS
413libsigrok_la_SOURCES += \
414 src/hardware/rigol-ds/protocol.h \
415 src/hardware/rigol-ds/protocol.c \
416 src/hardware/rigol-ds/api.c
417endif
418if HW_SALEAE_LOGIC16
419libsigrok_la_SOURCES += \
420 src/hardware/saleae-logic16/protocol.h \
421 src/hardware/saleae-logic16/protocol.c \
422 src/hardware/saleae-logic16/api.c
423endif
424if HW_SCPI_PPS
425libsigrok_la_SOURCES += \
426 src/hardware/scpi-pps/protocol.h \
427 src/hardware/scpi-pps/protocol.c \
428 src/hardware/scpi-pps/profiles.c \
429 src/hardware/scpi-pps/api.c
430endif
431if HW_SERIAL_DMM
432libsigrok_la_SOURCES += \
433 src/hardware/serial-dmm/protocol.h \
434 src/hardware/serial-dmm/protocol.c \
435 src/hardware/serial-dmm/api.c
436endif
437if HW_SYSCLK_LWLA
438libsigrok_la_SOURCES += \
439 src/hardware/sysclk-lwla/lwla.h \
440 src/hardware/sysclk-lwla/lwla.c \
441 src/hardware/sysclk-lwla/lwla1016.c \
442 src/hardware/sysclk-lwla/lwla1034.c \
443 src/hardware/sysclk-lwla/protocol.h \
444 src/hardware/sysclk-lwla/protocol.c \
445 src/hardware/sysclk-lwla/api.c
446endif
447if HW_TELEINFO
448libsigrok_la_SOURCES += \
449 src/hardware/teleinfo/protocol.h \
450 src/hardware/teleinfo/protocol.c \
451 src/hardware/teleinfo/api.c
452endif
453if HW_TESTO
454libsigrok_la_SOURCES += \
455 src/hardware/testo/protocol.h \
456 src/hardware/testo/protocol.c \
457 src/hardware/testo/api.c
458endif
459if HW_TONDAJ_SL_814
460libsigrok_la_SOURCES += \
461 src/hardware/tondaj-sl-814/protocol.h \
462 src/hardware/tondaj-sl-814/protocol.c \
463 src/hardware/tondaj-sl-814/api.c
464endif
465if HW_UNI_T_DMM
466libsigrok_la_SOURCES += \
467 src/hardware/uni-t-dmm/protocol.h \
468 src/hardware/uni-t-dmm/protocol.c \
469 src/hardware/uni-t-dmm/api.c
470endif
471if HW_UNI_T_UT32X
472libsigrok_la_SOURCES += \
473 src/hardware/uni-t-ut32x/protocol.h \
474 src/hardware/uni-t-ut32x/protocol.c \
475 src/hardware/uni-t-ut32x/api.c
476endif
477if HW_VICTOR_DMM
478libsigrok_la_SOURCES += \
479 src/hardware/victor-dmm/protocol.h \
480 src/hardware/victor-dmm/protocol.c \
481 src/hardware/victor-dmm/api.c
482endif
483if HW_YOKOGAWA_DLM
484libsigrok_la_SOURCES += \
485 src/hardware/yokogawa-dlm/protocol.h \
486 src/hardware/yokogawa-dlm/protocol.c \
487 src/hardware/yokogawa-dlm/protocol_wrappers.h \
488 src/hardware/yokogawa-dlm/protocol_wrappers.c \
489 src/hardware/yokogawa-dlm/api.c
490endif
491if HW_ZEROPLUS_LOGIC_CUBE
492libsigrok_la_SOURCES += \
493 src/hardware/zeroplus-logic-cube/analyzer.c \
494 src/hardware/zeroplus-logic-cube/analyzer.h \
495 src/hardware/zeroplus-logic-cube/gl_usb.h \
496 src/hardware/zeroplus-logic-cube/gl_usb.c \
497 src/hardware/zeroplus-logic-cube/protocol.h \
498 src/hardware/zeroplus-logic-cube/protocol.c \
499 src/hardware/zeroplus-logic-cube/api.c
500endif
501
502libsigrok_la_LIBADD = $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
503libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
504
505library_includedir = $(includedir)/libsigrok
506library_include_HEADERS = \
507 include/libsigrok/libsigrok.h \
508 include/libsigrok/proto.h
509nodist_library_include_HEADERS = \
510 include/libsigrok/version.h
511noinst_HEADERS = src/libsigrok-internal.h
512
513pkgconfigdir = $(libdir)/pkgconfig
514pkgconfig_DATA = libsigrok.pc
515
516EXTRA_DIST = \
517 Doxyfile \
518 HACKING \
519 README.devices \
520 bindings/cxx/ConfigKey_methods.cpp \
521 bindings/cxx/ConfigKey_methods.hpp \
522 bindings/cxx/ConfigKey_methods.i \
523 bindings/cxx/Doxyfile \
524 bindings/cxx/QuantityFlag_methods.cpp \
525 bindings/cxx/QuantityFlag_methods.hpp \
526 bindings/cxx/enums.py \
527 bindings/python/Doxyfile \
528 bindings/python/setup.py \
529 bindings/python/sigrok/__init__.py \
530 bindings/python/sigrok/core/__init__.py \
531 bindings/python/sigrok/core/classes.i \
532 bindings/java/Doxyfile \
533 bindings/java/org/sigrok/core/classes/classes.i \
534 bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
535 bindings/java/org/sigrok/core/interfaces/LogCallback.java \
536 bindings/swig/classes.i \
537 bindings/swig/doc.py \
538 bindings/swig/templates.i \
539 contrib/gnuplot_chronovu_la8.gpi \
540 contrib/gnuplot_rigol_ds1xx2.gpi \
541 contrib/gnuplot_usbeesx.gpi \
542 contrib/gnuplot_usbeedx8.gpi \
543 contrib/gnuplot_usbeedx16.gpi \
544 contrib/sigrok-logo-notext.png \
545 contrib/z60_libsigrok.rules
546
547if HAVE_CHECK
548TESTS = tests/main
549check_PROGRAMS = ${TESTS}
550endif
551
552tests_main_SOURCES = \
553 include/libsigrok/libsigrok.h \
554 tests/lib.c \
555 tests/lib.h \
556 tests/main.c \
557 tests/core.c \
558 tests/input_all.c \
559 tests/input_binary.c \
560 tests/output_all.c \
561 tests/transform_all.c \
562 tests/session.c \
563 tests/strutil.c \
564 tests/version.c \
565 tests/driver_all.c \
566 tests/device.c \
567 tests/trigger.c \
568 tests/analog.c
569
570tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
571
572BUILD_EXTRA =
573INSTALL_EXTRA =
574UNINSTALL_EXTRA =
575CLEAN_EXTRA =
576
577if BINDINGS_CXX
578
579lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
580
581bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
582
583bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
584bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
585
586bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
587bindings_cxx_libsigrokcxx_la_include_HEADERS = \
588 bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
589nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
590 bindings/cxx/include/libsigrokcxx/enums.hpp
591
592pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
593
594doxy/xml/index.xml: include/libsigrok/libsigrok.h
595 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
596
597bindings/swig/enums.i: bindings/cxx/enums.timestamp
598bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
599bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
600
601bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
602 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
603 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
604 $(AM_V_at)touch $@
605
606bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
607 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
608
609cxx-clean:
610 rm -rf doxy/
611 rm -rf bindings/cxx/doxy/
612 rm -f bindings/swig/enums.i
613 rm -f bindings/cxx/enums.cpp
614 rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
615 rm -f bindings/cxx/enums.timestamp
616
617CLEAN_EXTRA += cxx-clean
618
619endif
620
621CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
622
623$(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
624 bindings/cxx/enums.timestamp
625 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
626
627# Macro definitions to be used by the SWIG parser.
628swig_defs = -Dnoexcept= -Dprivate=protected -DG_GNUC_BEGIN_IGNORE_DEPRECATIONS= -DG_GNUC_END_IGNORE_DEPRECATIONS=
629
630if BINDINGS_PYTHON
631
632PDIR = bindings/python
633PDOC_START = bindings/python/sigrok/core/doc_start.i
634PDOC_END = bindings/python/sigrok/core/doc_end.i
635
636setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' CXXFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' LDADD='$(PYSIGROK_LIBS)'
637setup_quiet = --quiet
638setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
639
640$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
641 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
642 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
643
644$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
645 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
646 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
647
648python-build: $(PDIR)/timestamp
649
650$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
651 bindings/swig/classes.i bindings/swig/templates.i \
652 bindings/swig/enums.i $(PDOC_START) $(PDOC_END) \
653 $(library_include_HEADERS) \
654 $(nodist_library_include_HEADERS) \
655 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
656 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
657 @ORDER@ bindings/cxx/libsigrokcxx.la
658 $(AM_V_at)$(setup_py) clean --all 2>/dev/null
659 $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" --swig-opts '$(swig_defs)' build_py
660 $(AM_V_at): >$@
661
662python-install:
663 $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
664 destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
665 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
666
667python-clean:
668 -$(AM_V_at)rm -f $(PDIR)/timestamp
669 -$(AM_V_at)rm -fr $(PDIR)/doxy
670 -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
671
672python-doc:
673 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
674
675BUILD_EXTRA += python-build
676INSTALL_EXTRA += python-install
677CLEAN_EXTRA += python-clean
678
679endif
680
681if BINDINGS_RUBY
682
683RDIR = bindings/ruby
684RDOC = $(RDIR)/doc.i
685RWRAP = $(RDIR)/classes_wrap.cpp
686ROBJ = $(RWRAP:.cpp=.o)
687REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
688
689$(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
690 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
691
692$(RWRAP): $(RDIR)/classes.i $(RDOC) \
693 bindings/swig/classes.i bindings/swig/templates.i \
694 bindings/swig/enums.i
695 $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include $(swig_defs) -o $@ $<
696
697$(ROBJ): $(RWRAP) \
698 $(library_include_HEADERS) \
699 $(nodist_library_include_HEADERS) \
700 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
701 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
702 $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include -fPIC -o $@ -c $<
703
704$(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
705 $(AM_V_CXXLD)$(CXX) -shared -std=c++11 -o $@ $< -lsigrokcxx -Lbindings/cxx/.libs $(RBSIGROK_LIBS)
706
707ruby-build: $(REXT)
708
709ruby-install: $(REXT)
710 $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
711 $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
712
713ruby-clean:
714 -$(AM_V_at)rm -fr $(RDIR)/doc
715 -$(AM_V_at)rm $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
716
717ruby-doc: $(RWRAP)
718 $(AM_V_at)yard doc -o $(RDIR)/doc $<
719
720BUILD_EXTRA += ruby-build
721INSTALL_EXTRA += ruby-install
722CLEAN_EXTRA += ruby-clean
723
724endif
725
726if BINDINGS_JAVA
727
728JDIR = bindings/java
729JPKG = org/sigrok/core
730JCLS = $(JDIR)/$(JPKG)/classes
731JINT = $(JDIR)/$(JPKG)/interfaces
732JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
733JSWG = $(JCLS)/classes.i
734JDOC = $(JCLS)/doc.i
735JCXX = $(JCLS)/classes_wrap.cxx
736JLIB = $(JDIR)/libsigrok_java_core_classes.so
737JJAR = $(JDIR)/sigrok-core.jar
738
739java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
740
741java-build: $(JJAR) $(JLIB)
742
743$(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
744 $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
745 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
746
747$(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i \
748 bindings/swig/templates.i bindings/swig/enums.i \
749 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
750 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
751 -$(AM_V_at)rm -f $(java_cleanfiles)
752 $(AM_V_GEN)$(SWIG) -c++ $(swig_defs) \
753 -java -package org.sigrok.core.classes \
754 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
755 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
756
757$(JJAR): $(JCXX)
758 $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
759 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
760
761$(JLIB): $(JCXX) \
762 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
763 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
764 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
765 @ORDER@ bindings/cxx/libsigrokcxx.la
766 $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
767 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
768 -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
769
770java-install:
771 $(INSTALL) -d $(DESTDIR)$(libdir)/jni
772 $(INSTALL) $(JLIB) $(DESTDIR)$(libdir)/jni
773 $(INSTALL) -d $(DESTDIR)$(datadir)/java
774 $(INSTALL) $(JJAR) $(DESTDIR)$(datadir)/java
775
776java-uninstall:
777 -rm -f $(DESTDIR)$(datadir)/java/sigrok-core.jar
778 -rm -f $(DESTDIR)$(libdir)/jni/libsigrok_java_core_classes.so
779
780java-clean:
781 -$(AM_V_at)rm -f $(java_cleanfiles) $(JDOC)
782 -$(AM_V_at)rm -fr $(JDIR)/doxy
783
784java-doc:
785 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
786
787BUILD_EXTRA += java-build
788INSTALL_EXTRA += java-install
789UNINSTALL_EXTRA += java-uninstall
790CLEAN_EXTRA += java-clean
791
792endif
793
794all-local: $(BUILD_EXTRA)
795install-exec-local: $(INSTALL_EXTRA)
796uninstall-local: $(UNINSTALL_EXTRA)
797clean-local: $(CLEAN_EXTRA)
798
799.PHONY: dist-changelog
800
801dist-hook: dist-changelog
802
803dist-changelog:
804 $(AM_V_at)if test ! -d '$(top_srcdir)/.git'; then \
805 cp -f '$(top_srcdir)/ChangeLog' "$(top_distdir)/ChangeLog"; \
806 elif git -C '$(top_srcdir)' log >.ChangeLog.tmp; then \
807 mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
808 else \
809 rm -f .ChangeLog.tmp; exit 1; \
810 fi
811