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