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