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