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