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