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