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