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