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