]> sigrok.org Git - libsigrok.git/blame_incremental - Makefile.am
asix-sigma: Split into api.c and protocol.[ch] modules.
[libsigrok.git] / Makefile.am
... / ...
CommitLineData
1##
2## This file is part of the libsigrok project.
3##
4## Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
5## Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
6##
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.
11##
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.
16##
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/>.
19##
20
21ACLOCAL_AMFLAGS = -I m4
22AM_LIBTOOLFLAGS = --silent
23GNUMAKEFLAGS = --no-print-directory
24
25FIRMWARE_DIR = $(datadir)/sigrok-firmware
26
27local_includes = -Iinclude -I$(srcdir)/include -I$(srcdir)/src -I.
28if BINDINGS_CXX
29local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
30endif
31# Do not hard-code the firmware location on Windows.
32if WIN32
33global_defs =
34else
35global_defs = -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
36endif
37# Ensure that local include directories are always searched first.
38AM_CPPFLAGS = $(local_includes) $(global_defs)
39
40# The tests CFLAGS are a superset of the libsigrok CFLAGS, and the
41# python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
42AM_CFLAGS = $(SR_EXTRA_CFLAGS) $(SR_WFLAGS) $(TESTS_CFLAGS)
43AM_CXXFLAGS = $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)
44
45lib_LTLIBRARIES = libsigrok.la
46
47# Backend files
48libsigrok_la_SOURCES = \
49 src/backend.c \
50 src/device.c \
51 src/session.c \
52 src/session_file.c \
53 src/session_driver.c \
54 src/drivers.c \
55 src/hwdriver.c \
56 src/trigger.c \
57 src/soft-trigger.c \
58 src/analog.c \
59 src/fallback.c \
60 src/resource.c \
61 src/strutil.c \
62 src/log.c \
63 src/version.c \
64 src/error.c \
65 src/std.c
66
67# Input modules
68libsigrok_la_SOURCES += \
69 src/input/input.c \
70 src/input/binary.c \
71 src/input/chronovu_la8.c \
72 src/input/csv.c \
73 src/input/vcd.c \
74 src/input/wav.c
75
76# Output modules
77libsigrok_la_SOURCES += \
78 src/output/output.c \
79 src/output/analog.c \
80 src/output/ascii.c \
81 src/output/bits.c \
82 src/output/binary.c \
83 src/output/csv.c \
84 src/output/chronovu_la8.c \
85 src/output/wav.c \
86 src/output/gnuplot.c \
87 src/output/hex.c \
88 src/output/ols.c \
89 src/output/srzip.c \
90 src/output/vcd.c
91
92# Transform modules
93libsigrok_la_SOURCES += \
94 src/transform/transform.c \
95 src/transform/nop.c \
96 src/transform/scale.c \
97 src/transform/invert.c
98
99# SCPI support
100libsigrok_la_SOURCES += \
101 src/scpi/scpi.c \
102 src/scpi/helpers.c \
103 src/scpi/scpi_tcp.c
104if NEED_RPC
105libsigrok_la_SOURCES += \
106 src/scpi/scpi_vxi.c \
107 src/scpi/vxi_clnt.c \
108 src/scpi/vxi_xdr.c \
109 src/scpi/vxi.h
110endif
111if NEED_SERIAL
112libsigrok_la_SOURCES += \
113 src/serial.c \
114 src/scpi/scpi_serial.c
115endif
116if NEED_USB
117libsigrok_la_SOURCES += \
118 src/ezusb.c \
119 src/usb.c \
120 src/scpi/scpi_usbtmc_libusb.c
121endif
122if NEED_VISA
123libsigrok_la_SOURCES += \
124 src/scpi/scpi_visa.c
125endif
126if NEED_GPIB
127libsigrok_la_SOURCES += \
128 src/scpi/scpi_libgpib.c
129endif
130
131# Modbus support
132libsigrok_la_SOURCES += \
133 src/modbus/modbus.c
134if NEED_SERIAL
135libsigrok_la_SOURCES += \
136 src/modbus/modbus_serial_rtu.c
137endif
138
139# Hardware (DMM chip parsers)
140libsigrok_la_SOURCES += \
141 src/dmm/es519xx.c \
142 src/dmm/fs9721.c \
143 src/dmm/fs9922.c \
144 src/dmm/m2110.c \
145 src/dmm/metex14.c \
146 src/dmm/rs9lcd.c \
147 src/dmm/bm25x.c \
148 src/dmm/ut71x.c \
149 src/dmm/ut372.c \
150 src/dmm/vc870.c
151
152# Hardware (LCR chip parsers)
153if NEED_SERIAL
154libsigrok_la_SOURCES += \
155 src/lcr/es51919.c
156endif
157
158# Hardware (Scale protocol parsers)
159libsigrok_la_SOURCES += \
160 src/scale/kern.c
161
162# Hardware drivers
163if HW_AGILENT_DMM
164libsigrok_la_SOURCES += \
165 src/hardware/agilent-dmm/api.c \
166 src/hardware/agilent-dmm/agilent-dmm.h \
167 src/hardware/agilent-dmm/sched.c
168endif
169if HW_APPA_55II
170libsigrok_la_SOURCES += \
171 src/hardware/appa-55ii/protocol.h \
172 src/hardware/appa-55ii/protocol.c \
173 src/hardware/appa-55ii/api.c
174endif
175if HW_ASIX_SIGMA
176libsigrok_la_SOURCES += \
177 src/hardware/asix-sigma/protocol.h \
178 src/hardware/asix-sigma/protocol.c \
179 src/hardware/asix-sigma/api.c
180endif
181if HW_ATTEN_PPS3XXX
182libsigrok_la_SOURCES += \
183 src/hardware/atten-pps3xxx/protocol.h \
184 src/hardware/atten-pps3xxx/protocol.c \
185 src/hardware/atten-pps3xxx/api.c
186endif
187if HW_BAYLIBRE_ACME
188libsigrok_la_SOURCES += \
189 src/hardware/baylibre-acme/protocol.h \
190 src/hardware/baylibre-acme/protocol.c \
191 src/hardware/baylibre-acme/api.c \
192 src/hardware/baylibre-acme/gpio.h \
193 src/hardware/baylibre-acme/gpio.c
194endif
195if HW_BEAGLELOGIC
196libsigrok_la_SOURCES += \
197 src/hardware/beaglelogic/beaglelogic.h \
198 src/hardware/beaglelogic/protocol.h \
199 src/hardware/beaglelogic/protocol.c \
200 src/hardware/beaglelogic/api.c
201endif
202if HW_BRYMEN_BM86X
203libsigrok_la_SOURCES += \
204 src/hardware/brymen-bm86x/protocol.h \
205 src/hardware/brymen-bm86x/protocol.c \
206 src/hardware/brymen-bm86x/api.c
207endif
208if HW_BRYMEN_DMM
209libsigrok_la_SOURCES += \
210 src/hardware/brymen-dmm/parser.c \
211 src/hardware/brymen-dmm/protocol.h \
212 src/hardware/brymen-dmm/protocol.c \
213 src/hardware/brymen-dmm/api.c
214endif
215if HW_CEM_DT_885X
216libsigrok_la_SOURCES += \
217 src/hardware/cem-dt-885x/protocol.h \
218 src/hardware/cem-dt-885x/protocol.c \
219 src/hardware/cem-dt-885x/api.c
220endif
221if HW_CENTER_3XX
222libsigrok_la_SOURCES += \
223 src/hardware/center-3xx/protocol.h \
224 src/hardware/center-3xx/protocol.c \
225 src/hardware/center-3xx/api.c
226endif
227if HW_CHRONOVU_LA
228libsigrok_la_SOURCES += \
229 src/hardware/chronovu-la/protocol.h \
230 src/hardware/chronovu-la/protocol.c \
231 src/hardware/chronovu-la/api.c
232endif
233if HW_COLEAD_SLM
234libsigrok_la_SOURCES += \
235 src/hardware/colead-slm/protocol.h \
236 src/hardware/colead-slm/protocol.c \
237 src/hardware/colead-slm/api.c
238endif
239if HW_CONRAD_DIGI_35_CPU
240libsigrok_la_SOURCES += \
241 src/hardware/conrad-digi-35-cpu/protocol.h \
242 src/hardware/conrad-digi-35-cpu/protocol.c \
243 src/hardware/conrad-digi-35-cpu/api.c
244endif
245if HW_DEMO
246libsigrok_la_SOURCES += \
247 src/hardware/demo/demo.c
248endif
249if HW_DEREE_DE5000
250libsigrok_la_SOURCES += \
251 src/hardware/deree-de5000/api.c
252endif
253if HW_FLUKE_DMM
254libsigrok_la_SOURCES += \
255 src/hardware/fluke-dmm/fluke-dmm.h \
256 src/hardware/fluke-dmm/fluke.c \
257 src/hardware/fluke-dmm/api.c
258endif
259if HW_FX2LAFW
260libsigrok_la_SOURCES += \
261 src/hardware/fx2lafw/protocol.h \
262 src/hardware/fx2lafw/protocol.c \
263 src/hardware/fx2lafw/api.c \
264 src/hardware/fx2lafw/dslogic.c \
265 src/hardware/fx2lafw/dslogic.h
266endif
267if HW_GMC_MH_1X_2X
268libsigrok_la_SOURCES += \
269 src/hardware/gmc-mh-1x-2x/protocol.h \
270 src/hardware/gmc-mh-1x-2x/protocol.c \
271 src/hardware/gmc-mh-1x-2x/api.c
272endif
273if HW_GWINSTEK_GDS_800
274libsigrok_la_SOURCES += \
275 src/hardware/gwinstek-gds-800/protocol.h \
276 src/hardware/gwinstek-gds-800/protocol.c \
277 src/hardware/gwinstek-gds-800/api.c
278endif
279if HW_HAMEG_HMO
280libsigrok_la_SOURCES += \
281 src/hardware/hameg-hmo/protocol.h \
282 src/hardware/hameg-hmo/protocol.c \
283 src/hardware/hameg-hmo/api.c
284endif
285if HW_HANTEK_DSO
286libsigrok_la_SOURCES += \
287 src/hardware/hantek-dso/dso.h \
288 src/hardware/hantek-dso/dso.c \
289 src/hardware/hantek-dso/api.c
290endif
291if HW_HUNG_CHANG_DSO_2100
292libsigrok_la_SOURCES += \
293 src/hardware/hung-chang-dso-2100/protocol.h \
294 src/hardware/hung-chang-dso-2100/protocol.c \
295 src/hardware/hung-chang-dso-2100/api.c
296endif
297if HW_IKALOGIC_SCANALOGIC2
298libsigrok_la_SOURCES += \
299 src/hardware/ikalogic-scanalogic2/protocol.h \
300 src/hardware/ikalogic-scanalogic2/protocol.c \
301 src/hardware/ikalogic-scanalogic2/api.c
302endif
303if HW_IKALOGIC_SCANAPLUS
304libsigrok_la_SOURCES += \
305 src/hardware/ikalogic-scanaplus/protocol.h \
306 src/hardware/ikalogic-scanaplus/protocol.c \
307 src/hardware/ikalogic-scanaplus/api.c
308endif
309if HW_KECHENG_KC_330B
310libsigrok_la_SOURCES += \
311 src/hardware/kecheng-kc-330b/protocol.h \
312 src/hardware/kecheng-kc-330b/protocol.c \
313 src/hardware/kecheng-kc-330b/api.c
314endif
315if HW_KERN_SCALE
316libsigrok_la_SOURCES += \
317 src/hardware/kern-scale/protocol.h \
318 src/hardware/kern-scale/protocol.c \
319 src/hardware/kern-scale/api.c
320endif
321if HW_KORAD_KDXXXXP
322libsigrok_la_SOURCES += \
323 src/hardware/korad-kdxxxxp/protocol.h \
324 src/hardware/korad-kdxxxxp/protocol.c \
325 src/hardware/korad-kdxxxxp/api.c
326endif
327if HW_LASCAR_EL_USB
328libsigrok_la_SOURCES += \
329 src/hardware/lascar-el-usb/protocol.h \
330 src/hardware/lascar-el-usb/protocol.c \
331 src/hardware/lascar-el-usb/api.c
332endif
333if HW_MANSON_HCS_3XXX
334libsigrok_la_SOURCES += \
335 src/hardware/manson-hcs-3xxx/protocol.h \
336 src/hardware/manson-hcs-3xxx/protocol.c \
337 src/hardware/manson-hcs-3xxx/api.c
338endif
339if HW_MAYNUO_M97
340libsigrok_la_SOURCES += \
341 src/hardware/maynuo-m97/protocol.h \
342 src/hardware/maynuo-m97/protocol.c \
343 src/hardware/maynuo-m97/api.c
344endif
345if HW_MIC_985XX
346libsigrok_la_SOURCES += \
347 src/hardware/mic-985xx/protocol.h \
348 src/hardware/mic-985xx/protocol.c \
349 src/hardware/mic-985xx/api.c
350endif
351if HW_MOTECH_LPS_30X
352libsigrok_la_SOURCES += \
353 src/hardware/motech-lps-30x/protocol.h \
354 src/hardware/motech-lps-30x/protocol.c \
355 src/hardware/motech-lps-30x/api.c
356endif
357if HW_NORMA_DMM
358libsigrok_la_SOURCES += \
359 src/hardware/norma-dmm/protocol.h \
360 src/hardware/norma-dmm/protocol.c \
361 src/hardware/norma-dmm/api.c
362endif
363if HW_OPENBENCH_LOGIC_SNIFFER
364libsigrok_la_SOURCES += \
365 src/hardware/openbench-logic-sniffer/protocol.h \
366 src/hardware/openbench-logic-sniffer/protocol.c \
367 src/hardware/openbench-logic-sniffer/api.c
368endif
369if HW_PIPISTRELLO_OLS
370libsigrok_la_SOURCES += \
371 src/hardware/pipistrello-ols/protocol.h \
372 src/hardware/pipistrello-ols/protocol.c \
373 src/hardware/pipistrello-ols/api.c
374endif
375if HW_RIGOL_DS
376libsigrok_la_SOURCES += \
377 src/hardware/rigol-ds/protocol.h \
378 src/hardware/rigol-ds/protocol.c \
379 src/hardware/rigol-ds/api.c
380endif
381if HW_SALEAE_LOGIC16
382libsigrok_la_SOURCES += \
383 src/hardware/saleae-logic16/protocol.h \
384 src/hardware/saleae-logic16/protocol.c \
385 src/hardware/saleae-logic16/api.c
386endif
387if HW_SCPI_PPS
388libsigrok_la_SOURCES += \
389 src/hardware/scpi-pps/protocol.h \
390 src/hardware/scpi-pps/protocol.c \
391 src/hardware/scpi-pps/profiles.c \
392 src/hardware/scpi-pps/api.c
393endif
394if HW_SERIAL_DMM
395libsigrok_la_SOURCES += \
396 src/hardware/serial-dmm/protocol.h \
397 src/hardware/serial-dmm/protocol.c \
398 src/hardware/serial-dmm/api.c
399endif
400if HW_SYSCLK_LWLA
401libsigrok_la_SOURCES += \
402 src/hardware/sysclk-lwla/lwla.h \
403 src/hardware/sysclk-lwla/lwla.c \
404 src/hardware/sysclk-lwla/protocol.h \
405 src/hardware/sysclk-lwla/protocol.c \
406 src/hardware/sysclk-lwla/api.c
407endif
408if HW_TELEINFO
409libsigrok_la_SOURCES += \
410 src/hardware/teleinfo/protocol.h \
411 src/hardware/teleinfo/protocol.c \
412 src/hardware/teleinfo/api.c
413endif
414if HW_TESTO
415libsigrok_la_SOURCES += \
416 src/hardware/testo/protocol.h \
417 src/hardware/testo/protocol.c \
418 src/hardware/testo/api.c
419endif
420if HW_TONDAJ_SL_814
421libsigrok_la_SOURCES += \
422 src/hardware/tondaj-sl-814/protocol.h \
423 src/hardware/tondaj-sl-814/protocol.c \
424 src/hardware/tondaj-sl-814/api.c
425endif
426if HW_UNI_T_DMM
427libsigrok_la_SOURCES += \
428 src/hardware/uni-t-dmm/protocol.h \
429 src/hardware/uni-t-dmm/protocol.c \
430 src/hardware/uni-t-dmm/api.c
431endif
432if HW_UNI_T_UT32X
433libsigrok_la_SOURCES += \
434 src/hardware/uni-t-ut32x/protocol.h \
435 src/hardware/uni-t-ut32x/protocol.c \
436 src/hardware/uni-t-ut32x/api.c
437endif
438if HW_VICTOR_DMM
439libsigrok_la_SOURCES += \
440 src/hardware/victor-dmm/protocol.h \
441 src/hardware/victor-dmm/protocol.c \
442 src/hardware/victor-dmm/api.c
443endif
444if HW_YOKOGAWA_DLM
445libsigrok_la_SOURCES += \
446 src/hardware/yokogawa-dlm/protocol.h \
447 src/hardware/yokogawa-dlm/protocol.c \
448 src/hardware/yokogawa-dlm/protocol_wrappers.h \
449 src/hardware/yokogawa-dlm/protocol_wrappers.c \
450 src/hardware/yokogawa-dlm/api.c
451endif
452if HW_ZEROPLUS_LOGIC_CUBE
453libsigrok_la_SOURCES += \
454 src/hardware/zeroplus-logic-cube/analyzer.c \
455 src/hardware/zeroplus-logic-cube/analyzer.h \
456 src/hardware/zeroplus-logic-cube/gl_usb.h \
457 src/hardware/zeroplus-logic-cube/gl_usb.c \
458 src/hardware/zeroplus-logic-cube/protocol.h \
459 src/hardware/zeroplus-logic-cube/protocol.c \
460 src/hardware/zeroplus-logic-cube/api.c
461endif
462
463libsigrok_la_LIBADD = $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
464libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
465
466library_includedir = $(includedir)/libsigrok
467library_include_HEADERS = \
468 include/libsigrok/libsigrok.h \
469 include/libsigrok/proto.h
470nodist_library_include_HEADERS = \
471 include/libsigrok/version.h
472noinst_HEADERS = src/libsigrok-internal.h
473
474pkgconfigdir = $(libdir)/pkgconfig
475pkgconfig_DATA = libsigrok.pc
476
477EXTRA_DIST = \
478 Doxyfile \
479 HACKING \
480 README.devices \
481 bindings/cxx/ConfigKey_methods.cpp \
482 bindings/cxx/ConfigKey_methods.hpp \
483 bindings/cxx/ConfigKey_methods.i \
484 bindings/cxx/Doxyfile \
485 bindings/cxx/QuantityFlag_methods.cpp \
486 bindings/cxx/QuantityFlag_methods.hpp \
487 bindings/cxx/enums.py \
488 bindings/python/Doxyfile \
489 bindings/python/setup.py \
490 bindings/python/sigrok/__init__.py \
491 bindings/python/sigrok/core/__init__.py \
492 bindings/python/sigrok/core/classes.i \
493 bindings/java/Doxyfile \
494 bindings/java/org/sigrok/core/classes/classes.i \
495 bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
496 bindings/java/org/sigrok/core/interfaces/LogCallback.java \
497 bindings/swig/classes.i \
498 bindings/swig/doc.py \
499 contrib/gnuplot_chronovu_la8.gpi \
500 contrib/gnuplot_rigol_ds1xx2.gpi \
501 contrib/gnuplot_usbeesx.gpi \
502 contrib/gnuplot_usbeedx8.gpi \
503 contrib/gnuplot_usbeedx16.gpi \
504 contrib/sigrok-logo-notext.png \
505 contrib/z60_libsigrok.rules
506
507if HAVE_CHECK
508TESTS = tests/main
509check_PROGRAMS = ${TESTS}
510endif
511
512tests_main_SOURCES = \
513 include/libsigrok/libsigrok.h \
514 tests/lib.c \
515 tests/lib.h \
516 tests/main.c \
517 tests/core.c \
518 tests/input_all.c \
519 tests/input_binary.c \
520 tests/output_all.c \
521 tests/transform_all.c \
522 tests/session.c \
523 tests/strutil.c \
524 tests/version.c \
525 tests/driver_all.c \
526 tests/device.c \
527 tests/trigger.c \
528 tests/analog.c
529
530tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
531
532BUILD_EXTRA =
533INSTALL_EXTRA =
534CLEAN_EXTRA =
535
536if BINDINGS_CXX
537
538lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
539
540bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
541
542bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
543bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
544
545bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
546bindings_cxx_libsigrokcxx_la_include_HEADERS = \
547 bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
548nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
549 bindings/cxx/include/libsigrokcxx/enums.hpp
550
551pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
552
553doxy/xml/index.xml: include/libsigrok/libsigrok.h
554 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
555
556bindings/swig/enums.i: bindings/cxx/enums.timestamp
557bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
558bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
559
560bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
561 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
562 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
563 $(AM_V_at)touch $@
564
565bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
566 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
567
568cxx-clean:
569 rm -rf doxy/
570 rm -rf bindings/cxx/doxy/
571 rm -f bindings/cxx/enums.cpp
572 rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
573 rm -f bindings/cxx/enums.timestamp
574
575CLEAN_EXTRA += cxx-clean
576
577endif
578
579CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
580
581$(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
582 bindings/cxx/enums.timestamp
583 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
584
585# Macro definitions to be used by the SWIG parser.
586swig_defs = -Dnoexcept= -Dprivate=protected -DG_GNUC_BEGIN_IGNORE_DEPRECATIONS= -DG_GNUC_END_IGNORE_DEPRECATIONS=
587
588if BINDINGS_PYTHON
589
590PDIR = bindings/python
591PDOC_START = bindings/python/sigrok/core/doc_start.i
592PDOC_END = bindings/python/sigrok/core/doc_end.i
593
594setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(AM_CXXFLAGS) $(CXXFLAGS)' CXXFLAGS='$(AM_CXXFLAGS) $(CXXFLAGS)' LDADD='$(PYSIGROK_LIBS)'
595setup_quiet = --quiet
596setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
597
598$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
599 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
600 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
601
602$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
603 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
604 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
605
606python-build: $(PDIR)/timestamp
607
608$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
609 bindings/swig/classes.i bindings/swig/templates.i \
610 bindings/swig/enums.i $(PDOC_START) $(PDOC_END) \
611 $(library_include_HEADERS) \
612 $(nodist_library_include_HEADERS) \
613 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
614 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
615 @ORDER@ bindings/cxx/libsigrokcxx.la
616 $(AM_V_at)$(setup_py) clean --all 2>/dev/null
617 $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" --swig-opts '$(swig_defs)' build_py
618 $(AM_V_at): >$@
619
620python-install:
621 $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
622 destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
623 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
624
625python-clean:
626 -$(AM_V_at)rm -f $(PDIR)/timestamp
627 -$(AM_V_at)rm -fr $(PDIR)/doxy
628 -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
629
630python-doc:
631 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
632
633BUILD_EXTRA += python-build
634INSTALL_EXTRA += python-install
635CLEAN_EXTRA += python-clean
636
637endif
638
639if BINDINGS_JAVA
640
641JDIR = bindings/java
642JPKG = org/sigrok/core
643JCLS = $(JDIR)/$(JPKG)/classes
644JINT = $(JDIR)/$(JPKG)/interfaces
645JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
646JSWG = $(JCLS)/classes.i
647JDOC = $(JCLS)/doc.i
648JCXX = $(JCLS)/classes_wrap.cxx
649JLIB = $(JDIR)/libsigrok_java_core_classes.so
650JJAR = $(JDIR)/sigrok-core.jar
651
652java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
653
654java-build: $(JJAR) $(JLIB)
655
656$(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
657 $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
658 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
659
660$(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i \
661 bindings/swig/templates.i bindings/swig/enums.i \
662 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
663 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
664 -$(AM_V_at)rm -f $(java_cleanfiles)
665 $(AM_V_GEN)$(SWIG) -c++ $(swig_defs) \
666 -java -package org.sigrok.core.classes \
667 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
668 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
669
670$(JJAR): $(JCXX)
671 $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
672 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
673
674$(JLIB): $(JCXX) \
675 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
676 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
677 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
678 @ORDER@ bindings/cxx/libsigrokcxx.la
679 $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
680 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
681 -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
682
683java-install:
684 $(INSTALL) -d $(DESTDIR)$(libdir)/jni
685 $(INSTALL) $(JLIB) $(DESTDIR)$(libdir)/jni
686 $(INSTALL) -d $(DESTDIR)$(datadir)/java
687 $(INSTALL) $(JJAR) $(DESTDIR)$(datadir)/java
688
689java-clean:
690 -$(AM_V_at)rm -f $(java_cleanfiles)
691 -$(AM_V_at)rm -fr $(JDIR)/doxy
692
693java-doc:
694 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
695
696BUILD_EXTRA += java-build
697INSTALL_EXTRA += java-install
698CLEAN_EXTRA += java-clean
699
700endif
701
702all-local: $(BUILD_EXTRA)
703install-exec-local: $(INSTALL_EXTRA)
704clean-local: $(CLEAN_EXTRA)
705
706MAINTAINERCLEANFILES = ChangeLog
707
708.PHONY: ChangeLog
709ChangeLog:
710 git --git-dir '$(top_srcdir)/.git' log >$@ || touch $@
711
712dist-hook: ChangeLog
713