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