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