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