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