]> sigrok.org Git - libsigrok.git/blame - Makefile.am
Refactor scan options check.
[libsigrok.git] / Makefile.am
CommitLineData
62c82025 1##
50985c20 2## This file is part of the libsigrok project.
62c82025 3##
c73d2ea4 4## Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
d375b3c3 5## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
62c82025 6##
a1bb33af
UH
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.
62c82025 11##
a1bb33af
UH
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.
62c82025 16##
a1bb33af
UH
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/>.
62c82025 19##
a1bb33af 20
d8521c93 21ACLOCAL_AMFLAGS = -I autostuff
826938d8 22
55e55a3f 23AM_CPPFLAGS = -I$(srcdir)/src -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
340f6e7a 24
8a7b47cd 25lib_LTLIBRARIES = libsigrok.la
a1bb33af 26
67bd8055 27# Backend files
a695d6c0 28libsigrok_la_SOURCES = \
155b680d
BV
29 src/backend.c \
30 src/device.c \
31 src/session.c \
32 src/session_file.c \
33 src/session_driver.c \
34 src/drivers.c \
35 src/hwdriver.c \
36 src/trigger.c \
37 src/soft-trigger.c \
fb019a0e 38 src/analog.c \
155b680d
BV
39 src/strutil.c \
40 src/log.c \
41 src/version.c \
42 src/error.c \
43 src/std.c
960a75e4 44
155b680d
BV
45# Input modules
46libsigrok_la_SOURCES += \
155b680d 47 src/input/input.c \
b84cba4d 48 src/input/binary.c \
02e24c0c 49 src/input/chronovu_la8.c \
41d214f6 50 src/input/csv.c \
7db06394 51 src/input/vcd.c \
155b680d 52 src/input/wav.c
67bd8055 53
155b680d
BV
54# Output modules
55libsigrok_la_SOURCES += \
56 src/output/output.c \
57 src/output/analog.c \
58 src/output/ascii.c \
59 src/output/bits.c \
60 src/output/binary.c \
61 src/output/csv.c \
62 src/output/chronovu_la8.c \
afaa75b9 63 src/output/wav.c \
155b680d
BV
64 src/output/gnuplot.c \
65 src/output/hex.c \
66 src/output/ols.c \
3250d8c7 67 src/output/srzip.c \
155b680d 68 src/output/vcd.c
67bd8055 69
155b680d 70# SCPI support
67bd8055 71libsigrok_la_SOURCES += \
155b680d
BV
72 src/scpi/scpi.c \
73 src/scpi/scpi_tcp.c
67bd8055
UH
74if NEED_RPC
75libsigrok_la_SOURCES += \
155b680d
BV
76 src/scpi/scpi_vxi.c \
77 src/scpi/vxi_clnt.c \
78 src/scpi/vxi_xdr.c \
79 src/scpi/vxi.h
67bd8055
UH
80endif
81if NEED_SERIAL
82libsigrok_la_SOURCES += \
155b680d
BV
83 src/serial.c \
84 src/scpi/scpi_serial.c
67bd8055
UH
85endif
86if NEED_USB
87libsigrok_la_SOURCES += \
155b680d
BV
88 src/ezusb.c \
89 src/usb.c \
90 src/scpi/scpi_usbtmc_libusb.c
67bd8055
UH
91endif
92if NEED_VISA
93libsigrok_la_SOURCES += \
155b680d 94 src/scpi/scpi_visa.c
67bd8055 95endif
bb2a4ed4
ML
96if NEED_GPIB
97libsigrok_la_SOURCES += \
7343ad1e 98 src/scpi/scpi_libgpib.c
bb2a4ed4 99endif
67bd8055 100
155b680d
BV
101# Hardware (DMM chip parsers)
102libsigrok_la_SOURCES += \
103 src/dmm/es519xx.c \
104 src/dmm/fs9721.c \
105 src/dmm/fs9922.c \
106 src/dmm/m2110.c \
107 src/dmm/metex14.c \
a24c3f4a 108 src/dmm/rs9lcd.c \
626027df
UH
109 src/dmm/bm25x.c \
110 src/dmm/ut71x.c
67bd8055 111
6bcb3ee8 112# Hardware (LCR chip parsers)
34d117af 113if HW_DEREE_DE5000
6bcb3ee8
JH
114libsigrok_la_SOURCES += \
115 src/lcr/es51919.c
34d117af 116endif
6bcb3ee8 117
67bd8055
UH
118# Hardware drivers
119if HW_AGILENT_DMM
120libsigrok_la_SOURCES += \
155b680d
BV
121 src/hardware/agilent-dmm/api.c \
122 src/hardware/agilent-dmm/agilent-dmm.h \
123 src/hardware/agilent-dmm/sched.c
67bd8055 124endif
67bd8055
UH
125if HW_APPA_55II
126libsigrok_la_SOURCES += \
155b680d
BV
127 src/hardware/appa-55ii/protocol.h \
128 src/hardware/appa-55ii/protocol.c \
129 src/hardware/appa-55ii/api.c
67bd8055
UH
130endif
131if HW_ASIX_SIGMA
132libsigrok_la_SOURCES += \
155b680d
BV
133 src/hardware/asix-sigma/asix-sigma.h \
134 src/hardware/asix-sigma/asix-sigma.c
67bd8055
UH
135endif
136if HW_ATTEN_PPS3XXX
137libsigrok_la_SOURCES += \
155b680d
BV
138 src/hardware/atten-pps3xxx/protocol.h \
139 src/hardware/atten-pps3xxx/protocol.c \
140 src/hardware/atten-pps3xxx/api.c
67bd8055 141endif
bb993797
KA
142if HW_BEAGLELOGIC
143libsigrok_la_SOURCES += \
3db4b08b 144 src/hardware/beaglelogic/beaglelogic.h \
155b680d
BV
145 src/hardware/beaglelogic/protocol.h \
146 src/hardware/beaglelogic/protocol.c \
147 src/hardware/beaglelogic/api.c
bb993797 148endif
67bd8055
UH
149if HW_BRYMEN_BM86X
150libsigrok_la_SOURCES += \
155b680d
BV
151 src/hardware/brymen-bm86x/protocol.h \
152 src/hardware/brymen-bm86x/protocol.c \
153 src/hardware/brymen-bm86x/api.c
67bd8055
UH
154endif
155if HW_BRYMEN_DMM
156libsigrok_la_SOURCES += \
155b680d
BV
157 src/hardware/brymen-dmm/parser.c \
158 src/hardware/brymen-dmm/protocol.h \
159 src/hardware/brymen-dmm/protocol.c \
160 src/hardware/brymen-dmm/api.c
67bd8055
UH
161endif
162if HW_CEM_DT_885X
163libsigrok_la_SOURCES += \
155b680d
BV
164 src/hardware/cem-dt-885x/protocol.h \
165 src/hardware/cem-dt-885x/protocol.c \
166 src/hardware/cem-dt-885x/api.c
67bd8055
UH
167endif
168if HW_CENTER_3XX
169libsigrok_la_SOURCES += \
155b680d
BV
170 src/hardware/center-3xx/protocol.h \
171 src/hardware/center-3xx/protocol.c \
172 src/hardware/center-3xx/api.c
67bd8055 173endif
7b356712 174if HW_CHRONOVU_LA
67bd8055 175libsigrok_la_SOURCES += \
155b680d
BV
176 src/hardware/chronovu-la/protocol.h \
177 src/hardware/chronovu-la/protocol.c \
178 src/hardware/chronovu-la/api.c
67bd8055
UH
179endif
180if HW_COLEAD_SLM
181libsigrok_la_SOURCES += \
155b680d
BV
182 src/hardware/colead-slm/protocol.h \
183 src/hardware/colead-slm/protocol.c \
184 src/hardware/colead-slm/api.c
67bd8055
UH
185endif
186if HW_CONRAD_DIGI_35_CPU
187libsigrok_la_SOURCES += \
155b680d
BV
188 src/hardware/conrad-digi-35-cpu/protocol.h \
189 src/hardware/conrad-digi-35-cpu/protocol.c \
190 src/hardware/conrad-digi-35-cpu/api.c
67bd8055
UH
191endif
192if HW_DEMO
193libsigrok_la_SOURCES += \
155b680d 194 src/hardware/demo/demo.c
67bd8055 195endif
b5089195
JH
196if HW_DEREE_DE5000
197libsigrok_la_SOURCES += \
198 src/hardware/deree-de5000/api.c
199endif
67bd8055
UH
200if HW_FLUKE_DMM
201libsigrok_la_SOURCES += \
155b680d
BV
202 src/hardware/fluke-dmm/fluke-dmm.h \
203 src/hardware/fluke-dmm/fluke.c \
204 src/hardware/fluke-dmm/api.c
67bd8055
UH
205endif
206if HW_FX2LAFW
207libsigrok_la_SOURCES += \
155b680d
BV
208 src/hardware/fx2lafw/protocol.h \
209 src/hardware/fx2lafw/protocol.c \
210 src/hardware/fx2lafw/api.c
67bd8055
UH
211endif
212if HW_GMC_MH_1X_2X
213libsigrok_la_SOURCES += \
155b680d
BV
214 src/hardware/gmc-mh-1x-2x/protocol.h \
215 src/hardware/gmc-mh-1x-2x/protocol.c \
216 src/hardware/gmc-mh-1x-2x/api.c
67bd8055
UH
217endif
218if HW_HAMEG_HMO
219libsigrok_la_SOURCES += \
155b680d
BV
220 src/hardware/hameg-hmo/protocol.h \
221 src/hardware/hameg-hmo/protocol.c \
222 src/hardware/hameg-hmo/api.c
67bd8055
UH
223endif
224if HW_HANTEK_DSO
225libsigrok_la_SOURCES += \
155b680d
BV
226 src/hardware/hantek-dso/dso.h \
227 src/hardware/hantek-dso/dso.c \
228 src/hardware/hantek-dso/api.c
67bd8055
UH
229endif
230if HW_IKALOGIC_SCANALOGIC2
231libsigrok_la_SOURCES += \
155b680d
BV
232 src/hardware/ikalogic-scanalogic2/protocol.h \
233 src/hardware/ikalogic-scanalogic2/protocol.c \
234 src/hardware/ikalogic-scanalogic2/api.c
67bd8055
UH
235endif
236if HW_IKALOGIC_SCANAPLUS
237libsigrok_la_SOURCES += \
155b680d
BV
238 src/hardware/ikalogic-scanaplus/protocol.h \
239 src/hardware/ikalogic-scanaplus/protocol.c \
240 src/hardware/ikalogic-scanaplus/api.c
67bd8055
UH
241endif
242if HW_KECHENG_KC_330B
243libsigrok_la_SOURCES += \
155b680d
BV
244 src/hardware/kecheng-kc-330b/protocol.h \
245 src/hardware/kecheng-kc-330b/protocol.c \
246 src/hardware/kecheng-kc-330b/api.c
67bd8055
UH
247endif
248if HW_LASCAR_EL_USB
249libsigrok_la_SOURCES += \
155b680d
BV
250 src/hardware/lascar-el-usb/protocol.h \
251 src/hardware/lascar-el-usb/protocol.c \
252 src/hardware/lascar-el-usb/api.c
67bd8055 253endif
8f4e922f
UH
254if HW_MANSON_HCS_3XXX
255libsigrok_la_SOURCES += \
155b680d
BV
256 src/hardware/manson-hcs-3xxx/protocol.h \
257 src/hardware/manson-hcs-3xxx/protocol.c \
258 src/hardware/manson-hcs-3xxx/api.c
8f4e922f 259endif
67bd8055
UH
260if HW_MIC_985XX
261libsigrok_la_SOURCES += \
155b680d
BV
262 src/hardware/mic-985xx/protocol.h \
263 src/hardware/mic-985xx/protocol.c \
264 src/hardware/mic-985xx/api.c
67bd8055 265endif
41b7bd01
MH
266if HW_MOTECH_LPS_30X
267libsigrok_la_SOURCES += \
155b680d
BV
268 src/hardware/motech-lps-30x/protocol.h \
269 src/hardware/motech-lps-30x/protocol.c \
270 src/hardware/motech-lps-30x/api.c
41b7bd01 271endif
67bd8055
UH
272if HW_NORMA_DMM
273libsigrok_la_SOURCES += \
155b680d
BV
274 src/hardware/norma-dmm/protocol.h \
275 src/hardware/norma-dmm/protocol.c \
276 src/hardware/norma-dmm/api.c
67bd8055 277endif
d4b38748 278if HW_OPENBENCH_LOGIC_SNIFFER
67bd8055 279libsigrok_la_SOURCES += \
155b680d
BV
280 src/hardware/openbench-logic-sniffer/protocol.h \
281 src/hardware/openbench-logic-sniffer/protocol.c \
282 src/hardware/openbench-logic-sniffer/api.c
67bd8055 283endif
4bd80e12 284if HW_PIPISTRELLO_OLS
285libsigrok_la_SOURCES += \
286 src/hardware/pipistrello-ols/protocol.h \
287 src/hardware/pipistrello-ols/protocol.c \
288 src/hardware/pipistrello-ols/api.c
289endif
67bd8055
UH
290if HW_RIGOL_DS
291libsigrok_la_SOURCES += \
155b680d
BV
292 src/hardware/rigol-ds/protocol.h \
293 src/hardware/rigol-ds/protocol.c \
294 src/hardware/rigol-ds/api.c
67bd8055
UH
295endif
296if HW_SALEAE_LOGIC16
297libsigrok_la_SOURCES += \
155b680d
BV
298 src/hardware/saleae-logic16/protocol.h \
299 src/hardware/saleae-logic16/protocol.c \
300 src/hardware/saleae-logic16/api.c
67bd8055 301endif
ca1a7cb5
BV
302if HW_SCPI_PPS
303libsigrok_la_SOURCES += \
304 src/hardware/scpi-pps/protocol.h \
305 src/hardware/scpi-pps/protocol.c \
d4eabea8 306 src/hardware/scpi-pps/profiles.c \
ca1a7cb5
BV
307 src/hardware/scpi-pps/api.c
308endif
67bd8055
UH
309if HW_SERIAL_DMM
310libsigrok_la_SOURCES += \
155b680d
BV
311 src/hardware/serial-dmm/protocol.h \
312 src/hardware/serial-dmm/protocol.c \
313 src/hardware/serial-dmm/api.c
67bd8055
UH
314endif
315if HW_SYSCLK_LWLA
316libsigrok_la_SOURCES += \
155b680d
BV
317 src/hardware/sysclk-lwla/lwla.h \
318 src/hardware/sysclk-lwla/lwla.c \
319 src/hardware/sysclk-lwla/protocol.h \
320 src/hardware/sysclk-lwla/protocol.c \
321 src/hardware/sysclk-lwla/api.c
67bd8055
UH
322endif
323if HW_TELEINFO
324libsigrok_la_SOURCES += \
155b680d
BV
325 src/hardware/teleinfo/protocol.h \
326 src/hardware/teleinfo/protocol.c \
327 src/hardware/teleinfo/api.c
67bd8055 328endif
0acdd793
BV
329if HW_TESTO
330libsigrok_la_SOURCES += \
155b680d
BV
331 src/hardware/testo/protocol.h \
332 src/hardware/testo/protocol.c \
333 src/hardware/testo/api.c
0acdd793 334endif
67bd8055
UH
335if HW_TONDAJ_SL_814
336libsigrok_la_SOURCES += \
155b680d
BV
337 src/hardware/tondaj-sl-814/protocol.h \
338 src/hardware/tondaj-sl-814/protocol.c \
339 src/hardware/tondaj-sl-814/api.c
67bd8055
UH
340endif
341if HW_UNI_T_DMM
342libsigrok_la_SOURCES += \
155b680d
BV
343 src/hardware/uni-t-dmm/protocol.h \
344 src/hardware/uni-t-dmm/protocol.c \
345 src/hardware/uni-t-dmm/api.c
67bd8055
UH
346endif
347if HW_UNI_T_UT32X
348libsigrok_la_SOURCES += \
155b680d
BV
349 src/hardware/uni-t-ut32x/protocol.h \
350 src/hardware/uni-t-ut32x/protocol.c \
351 src/hardware/uni-t-ut32x/api.c
67bd8055
UH
352endif
353if HW_VICTOR_DMM
354libsigrok_la_SOURCES += \
155b680d
BV
355 src/hardware/victor-dmm/protocol.h \
356 src/hardware/victor-dmm/protocol.c \
357 src/hardware/victor-dmm/api.c
67bd8055 358endif
10763937
SA
359if HW_YOKOGAWA_DLM
360libsigrok_la_SOURCES += \
361 src/hardware/yokogawa-dlm/protocol.h \
362 src/hardware/yokogawa-dlm/protocol.c \
363 src/hardware/yokogawa-dlm/protocol_wrappers.h \
364 src/hardware/yokogawa-dlm/protocol_wrappers.c \
365 src/hardware/yokogawa-dlm/api.c
366endif
67bd8055
UH
367if HW_ZEROPLUS_LOGIC_CUBE
368libsigrok_la_SOURCES += \
155b680d
BV
369 src/hardware/zeroplus-logic-cube/analyzer.c \
370 src/hardware/zeroplus-logic-cube/analyzer.h \
371 src/hardware/zeroplus-logic-cube/gl_usb.h \
372 src/hardware/zeroplus-logic-cube/gl_usb.c \
373 src/hardware/zeroplus-logic-cube/protocol.h \
374 src/hardware/zeroplus-logic-cube/protocol.c \
375 src/hardware/zeroplus-logic-cube/api.c
67bd8055
UH
376endif
377
378libsigrok_la_LIBADD = $(LIBOBJS)
a1bb33af 379
6dddd902 380libsigrok_la_LDFLAGS = $(SR_LIB_LDFLAGS)
eeebceea 381
45c59c8b 382library_includedir = $(includedir)/libsigrok
63d0fb75
ML
383library_include_HEADERS = \
384 include/libsigrok/libsigrok.h \
385 include/libsigrok/proto.h \
386 include/libsigrok/version.h
155b680d 387noinst_HEADERS = src/libsigrok-internal.h
a1bb33af 388
8a7b47cd
UH
389pkgconfigdir = $(libdir)/pkgconfig
390pkgconfig_DATA = libsigrok.pc
d658e348 391
67bd8055
UH
392EXTRA_DIST = \
393 Doxyfile \
394 HACKING \
395 README.devices \
396 contrib/gnuplot_chronovu_la8.gpi \
397 contrib/gnuplot_rigol_ds1xx2.gpi \
398 contrib/gnuplot_usbeesx.gpi \
399 contrib/gnuplot_usbeedx8.gpi \
400 contrib/gnuplot_usbeedx16.gpi \
401 contrib/sigrok-logo-notext.png \
402 contrib/z60_libsigrok.rules
403
404if HAVE_CHECK
405
406TESTS = tests/check_main
407
408check_PROGRAMS = ${TESTS}
409
410tests_check_main_SOURCES = \
6592c369 411 include/libsigrok/libsigrok.h \
67bd8055
UH
412 tests/lib.c \
413 tests/lib.h \
414 tests/check_main.c \
415 tests/check_core.c \
416 tests/check_input_all.c \
417 tests/check_input_binary.c \
418 tests/check_output_all.c \
41723529 419 tests/check_session.c \
67bd8055
UH
420 tests/check_strutil.c \
421 tests/check_version.c \
6b1adfaa
UH
422 tests/check_driver_all.c \
423 tests/check_device.c
67bd8055
UH
424
425tests_check_main_CFLAGS = @check_CFLAGS@
426
427tests_check_main_LDADD = $(top_builddir)/libsigrok.la @check_LIBS@
428
429endif
dd8b5f56 430
580ed400
ML
431BUILD_EXTRA =
432INSTALL_EXTRA =
433CLEAN_EXTRA =
434
c23c8659
ML
435if BINDINGS_CXX
436
437lib_LTLIBRARIES += bindings/cxx/libsigrokxx.la
438
439bindings_cxx_libsigrokxx_la_SOURCES = bindings/cxx/classes.cpp
440
d1785122 441bindings_cxx_libsigrokxx_la_LIBADD = libsigrok.la $(glibmm_LIBS)
c23c8659
ML
442
443bindings_cxx_libsigrokxx_la_LDFLAGS = $(SR_LIB_LDFLAGS)
444
445library_include_HEADERS += \
446 bindings/cxx/include/libsigrok/libsigrok.hpp \
447 bindings/cxx/include/libsigrok/enums.hpp
448
449pkgconfig_DATA += bindings/cxx/libsigrokxx.pc
450
3532ed01 451doxy/xml/index.xml: include/libsigrok/libsigrok.h
7f82ec4d 452 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
580ed400
ML
453
454bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
455
456bindings/cxx/include/libsigrok/enums.hpp: bindings/cxx/enums.timestamp
c23c8659 457
3532ed01 458bindings/cxx/enums.timestamp: bindings/cxx/enums.py doxy/xml/index.xml \
c23c8659 459 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
da89e23a 460 $(AM_V_GEN)$(PYTHON) $< doxy/xml/index.xml
f2a189f0 461 $(AM_V_at)touch $@
c23c8659 462
580ed400
ML
463bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
464 $(library_include_HEADERS)
c23c8659 465
580ed400 466cxx-clean:
3532ed01 467 rm -rf doxy/
bd4fda24 468 rm -rf bindings/cxx/doxy/
580ed400
ML
469 rm -f bindings/cxx/enums.cpp
470 rm -f bindings/cxx/include/libsigrok/enums.hpp
471 rm -f bindings/cxx/enums.timestamp
c23c8659 472
580ed400
ML
473CLEAN_EXTRA += cxx-clean
474
475endif
f7740954 476
bd4fda24
ML
477CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
478
479$(CPPXMLDOC): bindings/cxx/include/libsigrok/libsigrok.hpp \
480 bindings/cxx/enums.timestamp
33c84e81 481 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
bd4fda24 482
f7740954
ML
483if BINDINGS_PYTHON
484
d1785122 485PDIR = bindings/python
bd4fda24
ML
486PDOC = bindings/python/sigrok/core/doc.i
487
488$(PDOC): bindings/swig/doc.py $(CPPXMLDOC)
0e1a7fe9 489 $(AM_V_at)test -d $(PDIR)/sigrok/core || mkdir -p $(PDIR)/sigrok/core
da89e23a 490 $(AM_V_GEN)$(PYTHON) $< python $(CPPXMLDOC) > $@
d1785122
ML
491
492python-build: $(PDIR)/timestamp
493
c26162ff 494python-quietclean:
da89e23a 495 $(AM_V_at)cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet clean --all 3>&1 1>&2 2>&3 \
c26162ff 496 | grep -v "can.t clean it"; true
8eb10b62 497
580ed400 498$(PDIR)/timestamp: bindings/cxx/libsigrokxx.la $(PDIR)/sigrok/core/classes.i \
bd4fda24 499 bindings/swig/classes.i $(PDOC) $(library_include_HEADERS)
c26162ff 500 $(AM_V_at)$(MAKE) python-quietclean
da89e23a 501 $(AM_V_GEN)cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet build 3>&1 1>&2 2>&3 \
c26162ff 502 | grep -v "command line option.*Wstrict-prototypes"; true
f2a189f0 503 $(AM_V_at)touch $(PDIR)/timestamp
f7740954
ML
504
505python-install:
da89e23a 506 cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet install --prefix $(prefix)
f7740954 507
c26162ff
BV
508python-clean:
509 $(AM_V_at)$(MAKE) python-quietclean
f2a189f0 510 $(AM_V_at)rm -f $(PDIR)/timestamp
6a8c1d68
ML
511 $(AM_V_at)rm -rf $(PDIR)/doxy/
512
513python-doc:
0e1a7fe9 514 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR=$(abs_builddir)/$(PDIR)/ doxygen Doxyfile 2>/dev/null
f7740954
ML
515
516BUILD_EXTRA += python-build
517INSTALL_EXTRA += python-install
518CLEAN_EXTRA += python-clean
519
520endif
521
9fcf4d0b
ML
522if BINDINGS_JAVA
523
524JDIR = bindings/java
90bd7656
ML
525JPKG = org/sigrok/core
526JCLS = $(JDIR)/$(JPKG)/classes
527JINT = $(JDIR)/$(JPKG)/interfaces
33c84e81 528JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
90bd7656 529JSWG = $(JCLS)/classes.i
bd4fda24 530JDOC = $(JCLS)/doc.i
90bd7656 531JCXX = $(JCLS)/classes_wrap.cxx
9fcf4d0b
ML
532JLIB = $(JDIR)/libsigrok_java_core_classes.so
533JJAR = $(JDIR)/sigrok-core.jar
534
535java-build: $(JJAR) $(JLIB)
536
bd4fda24 537$(JDOC): bindings/swig/doc.py $(CPPXMLDOC)
33c84e81
MC
538 $(AM_V_at)test -d $(JCLS) || mkdir -p $(JCLS)
539 $(AM_V_GEN)python $< java $(CPPXMLDOC) > $@
bd4fda24
ML
540
541$(JCXX): $(JSWG) $(JDOC) bindings/swig/classes.i $(library_include_HEADERS)
f1830b22 542 $(AM_V_at)make java-clean
f2a189f0 543 $(AM_V_GEN)swig -c++ -java -package org.sigrok.core.classes \
33c84e81 544 -I$(srcdir)/include -I$(srcdir)/bindings/cxx/include -I$(srcdir) -I$(JCLS) -Ibindings/cxx/include -outdir $(JCLS) -o $@ $<
9fcf4d0b 545
90bd7656 546$(JJAR): $(JCXX)
33c84e81 547 $(AM_V_GEN)$(JAVAC) -sourcepath $(JDIR) -d $(JDIR) $(JSRC)
f2a189f0 548 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
9fcf4d0b 549
90bd7656 550$(JLIB): $(JCXX) bindings/cxx/libsigrokxx.la $(library_include_HEADERS)
d1a5f737 551 $(AM_V_GEN)$(CXXCOMPILE) -L.libs -Lbindings/cxx/.libs \
90bd7656
ML
552 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
553 -lsigrokxx -o $(JLIB)
9fcf4d0b
ML
554
555java-install:
556 $(INSTALL) -d $(libdir)/jni
557 $(INSTALL) $(JLIB) -t $(libdir)/jni
558 $(INSTALL) -d $(datadir)/java
559 $(INSTALL) $(JJAR) -t $(datadir)/java
560
561java-clean:
2fe07d3f
BV
562 $(AM_V_at)rm -f $(JCXX)
563 $(AM_V_at)rm -f $(JCLS)/*.java
564 $(AM_V_at)rm -f $(JCLS)/*.class
565 $(AM_V_at)rm -f $(JINT)/*.class
566 $(AM_V_at)rm -f $(JJAR)
567 $(AM_V_at)rm -f $(JLIB)
568 $(AM_V_at)rm -rf $(JDIR)/doxy/
8a314e90
ML
569
570java-doc:
33c84e81 571 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR=$(abs_builddir)/$(JDIR)/ doxygen Doxyfile 2>/dev/null
9fcf4d0b
ML
572
573BUILD_EXTRA += java-build
574INSTALL_EXTRA += java-install
575CLEAN_EXTRA += java-clean
576
577endif
578
f7740954
ML
579all-local: $(BUILD_EXTRA)
580install-exec-local: $(INSTALL_EXTRA)
d1785122 581clean-local: $(CLEAN_EXTRA)
f7740954 582
c0958408 583MAINTAINERCLEANFILES = ChangeLog
0fc12d66
UH
584
585.PHONY: ChangeLog
586ChangeLog:
bd58d8f3 587 git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
0fc12d66
UH
588
589dist-hook: ChangeLog
590