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