]> sigrok.org Git - libsigrok.git/blame_incremental - Makefile.am
Put driver pointers into special section
[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_PIPISTRELLO_OLS
411libsigrok_la_SOURCES += \
412 src/hardware/pipistrello-ols/protocol.h \
413 src/hardware/pipistrello-ols/protocol.c \
414 src/hardware/pipistrello-ols/api.c
415endif
416if HW_RIGOL_DS
417libsigrok_la_SOURCES += \
418 src/hardware/rigol-ds/protocol.h \
419 src/hardware/rigol-ds/protocol.c \
420 src/hardware/rigol-ds/api.c
421endif
422if HW_SALEAE_LOGIC16
423libsigrok_la_SOURCES += \
424 src/hardware/saleae-logic16/protocol.h \
425 src/hardware/saleae-logic16/protocol.c \
426 src/hardware/saleae-logic16/api.c
427endif
428if HW_SCPI_PPS
429libsigrok_la_SOURCES += \
430 src/hardware/scpi-pps/protocol.h \
431 src/hardware/scpi-pps/protocol.c \
432 src/hardware/scpi-pps/profiles.c \
433 src/hardware/scpi-pps/api.c
434endif
435if HW_SERIAL_DMM
436libsigrok_la_SOURCES += \
437 src/hardware/serial-dmm/protocol.h \
438 src/hardware/serial-dmm/protocol.c \
439 src/hardware/serial-dmm/api.c
440endif
441if HW_SYSCLK_LWLA
442libsigrok_la_SOURCES += \
443 src/hardware/sysclk-lwla/lwla.h \
444 src/hardware/sysclk-lwla/lwla.c \
445 src/hardware/sysclk-lwla/lwla1016.c \
446 src/hardware/sysclk-lwla/lwla1034.c \
447 src/hardware/sysclk-lwla/protocol.h \
448 src/hardware/sysclk-lwla/protocol.c \
449 src/hardware/sysclk-lwla/api.c
450endif
451if HW_TELEINFO
452libsigrok_la_SOURCES += \
453 src/hardware/teleinfo/protocol.h \
454 src/hardware/teleinfo/protocol.c \
455 src/hardware/teleinfo/api.c
456endif
457if HW_TESTO
458libsigrok_la_SOURCES += \
459 src/hardware/testo/protocol.h \
460 src/hardware/testo/protocol.c \
461 src/hardware/testo/api.c
462endif
463if HW_TONDAJ_SL_814
464libsigrok_la_SOURCES += \
465 src/hardware/tondaj-sl-814/protocol.h \
466 src/hardware/tondaj-sl-814/protocol.c \
467 src/hardware/tondaj-sl-814/api.c
468endif
469if HW_UNI_T_DMM
470libsigrok_la_SOURCES += \
471 src/hardware/uni-t-dmm/protocol.h \
472 src/hardware/uni-t-dmm/protocol.c \
473 src/hardware/uni-t-dmm/api.c
474endif
475if HW_UNI_T_UT32X
476libsigrok_la_SOURCES += \
477 src/hardware/uni-t-ut32x/protocol.h \
478 src/hardware/uni-t-ut32x/protocol.c \
479 src/hardware/uni-t-ut32x/api.c
480endif
481if HW_VICTOR_DMM
482libsigrok_la_SOURCES += \
483 src/hardware/victor-dmm/protocol.h \
484 src/hardware/victor-dmm/protocol.c \
485 src/hardware/victor-dmm/api.c
486endif
487if HW_YOKOGAWA_DLM
488libsigrok_la_SOURCES += \
489 src/hardware/yokogawa-dlm/protocol.h \
490 src/hardware/yokogawa-dlm/protocol.c \
491 src/hardware/yokogawa-dlm/protocol_wrappers.h \
492 src/hardware/yokogawa-dlm/protocol_wrappers.c \
493 src/hardware/yokogawa-dlm/api.c
494endif
495if HW_ZEROPLUS_LOGIC_CUBE
496libsigrok_la_SOURCES += \
497 src/hardware/zeroplus-logic-cube/analyzer.c \
498 src/hardware/zeroplus-logic-cube/analyzer.h \
499 src/hardware/zeroplus-logic-cube/gl_usb.h \
500 src/hardware/zeroplus-logic-cube/gl_usb.c \
501 src/hardware/zeroplus-logic-cube/protocol.h \
502 src/hardware/zeroplus-logic-cube/protocol.c \
503 src/hardware/zeroplus-logic-cube/api.c
504endif
505
506# This entry must be placed after all drivers
507libsigrok_la_SOURCES += src/hardware/driver_list_end.c
508
509libsigrok_la_LIBADD = $(SR_EXTRA_LIBS) $(LIBSIGROK_LIBS)
510libsigrok_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
511
512library_includedir = $(includedir)/libsigrok
513library_include_HEADERS = \
514 include/libsigrok/libsigrok.h \
515 include/libsigrok/proto.h
516nodist_library_include_HEADERS = \
517 include/libsigrok/version.h
518noinst_HEADERS = src/libsigrok-internal.h
519
520pkgconfigdir = $(libdir)/pkgconfig
521pkgconfig_DATA = libsigrok.pc
522
523EXTRA_DIST = \
524 Doxyfile \
525 HACKING \
526 README.devices \
527 bindings/cxx/ConfigKey_methods.cpp \
528 bindings/cxx/ConfigKey_methods.hpp \
529 bindings/cxx/ConfigKey_methods.i \
530 bindings/cxx/Doxyfile \
531 bindings/cxx/QuantityFlag_methods.cpp \
532 bindings/cxx/QuantityFlag_methods.hpp \
533 bindings/cxx/enums.py \
534 bindings/python/Doxyfile \
535 bindings/python/setup.py \
536 bindings/python/sigrok/__init__.py \
537 bindings/python/sigrok/core/__init__.py \
538 bindings/python/sigrok/core/classes.i \
539 bindings/ruby/classes.i \
540 bindings/java/Doxyfile \
541 bindings/java/org/sigrok/core/classes/classes.i \
542 bindings/java/org/sigrok/core/interfaces/DatafeedCallback.java \
543 bindings/java/org/sigrok/core/interfaces/LogCallback.java \
544 bindings/swig/classes.i \
545 bindings/swig/doc.py \
546 bindings/swig/templates.i \
547 contrib/gnuplot_chronovu_la8.gpi \
548 contrib/gnuplot_rigol_ds1xx2.gpi \
549 contrib/gnuplot_usbeesx.gpi \
550 contrib/gnuplot_usbeedx8.gpi \
551 contrib/gnuplot_usbeedx16.gpi \
552 contrib/sigrok-logo-notext.png \
553 contrib/z60_libsigrok.rules
554
555if HAVE_CHECK
556TESTS = tests/main
557check_PROGRAMS = ${TESTS}
558endif
559
560tests_main_SOURCES = \
561 include/libsigrok/libsigrok.h \
562 tests/lib.c \
563 tests/lib.h \
564 tests/main.c \
565 tests/core.c \
566 tests/input_all.c \
567 tests/input_binary.c \
568 tests/output_all.c \
569 tests/transform_all.c \
570 tests/session.c \
571 tests/strutil.c \
572 tests/version.c \
573 tests/driver_all.c \
574 tests/device.c \
575 tests/trigger.c \
576 tests/analog.c
577
578tests_main_LDADD = libsigrok.la $(SR_EXTRA_LIBS) $(TESTS_LIBS)
579
580BUILD_EXTRA =
581INSTALL_EXTRA =
582UNINSTALL_EXTRA =
583CLEAN_EXTRA =
584
585if BINDINGS_CXX
586
587lib_LTLIBRARIES += bindings/cxx/libsigrokcxx.la
588
589bindings_cxx_libsigrokcxx_la_SOURCES = bindings/cxx/classes.cpp
590
591bindings_cxx_libsigrokcxx_la_LIBADD = libsigrok.la $(SR_EXTRA_LIBS) $(LIBSIGROKCXX_LIBS)
592bindings_cxx_libsigrokcxx_la_LDFLAGS = -version-info $(SR_LIB_VERSION) -no-undefined
593
594bindings_cxx_libsigrokcxx_la_includedir = $(includedir)/libsigrokcxx
595bindings_cxx_libsigrokcxx_la_include_HEADERS = \
596 bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
597nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS = \
598 bindings/cxx/include/libsigrokcxx/enums.hpp
599
600pkgconfig_DATA += bindings/cxx/libsigrokcxx.pc
601
602doxy/xml/index.xml: include/libsigrok/libsigrok.h
603 $(AM_V_GEN)cd $(srcdir) && BUILDDIR=$(abs_builddir)/ doxygen Doxyfile 2>/dev/null
604
605bindings/swig/enums.i: bindings/cxx/enums.timestamp
606bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
607bindings/cxx/include/libsigrokcxx/enums.hpp: bindings/cxx/enums.timestamp
608
609bindings/cxx/enums.timestamp: $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml \
610 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
611 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/cxx/enums.py doxy/xml/index.xml
612 $(AM_V_at)touch $@
613
614bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
615 $(library_include_HEADERS) $(nodist_library_include_HEADERS)
616
617cxx-clean:
618 rm -rf doxy/
619 rm -rf bindings/cxx/doxy/
620 rm -f bindings/swig/enums.i
621 rm -f bindings/cxx/enums.cpp
622 rm -f bindings/cxx/include/libsigrokcxx/enums.hpp
623 rm -f bindings/cxx/enums.timestamp
624
625CLEAN_EXTRA += cxx-clean
626
627endif
628
629CPPXMLDOC = bindings/cxx/doxy/xml/index.xml
630
631$(CPPXMLDOC): bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp \
632 bindings/cxx/enums.timestamp
633 $(AM_V_GEN)cd $(srcdir)/bindings/cxx && BUILDDIR=$(abs_builddir)/bindings/cxx/ doxygen Doxyfile 2>/dev/null
634
635# Macro definitions to be used by the SWIG parser.
636swig_defs = -Dnoexcept= -Dprivate=protected -DG_GNUC_BEGIN_IGNORE_DEPRECATIONS= -DG_GNUC_END_IGNORE_DEPRECATIONS=
637
638if BINDINGS_PYTHON
639
640PDIR = bindings/python
641PDOC_START = bindings/python/sigrok/core/doc_start.i
642PDOC_END = bindings/python/sigrok/core/doc_end.i
643
644setup_vars = VERSION='$(PACKAGE_VERSION)' CC='$(CXX)' CFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' CXXFLAGS='$(CXXFLAGS) $(SR_WXXFLAGS) $(PYSIGROK_CFLAGS)' LDADD='$(PYSIGROK_LIBS)'
645setup_quiet = --quiet
646setup_py = $(PYTHON) $(srcdir)/$(PDIR)/setup.py $(setup_vars) $(setup_quiet)
647
648$(PDOC_START): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
649 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
650 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) start > $@
651
652$(PDOC_END): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
653 $(AM_V_at)test -d $(PDIR)/sigrok/core || $(MKDIR_P) $(PDIR)/sigrok/core
654 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py python $(CPPXMLDOC) end > $@
655
656python-build: $(PDIR)/timestamp
657
658$(PDIR)/timestamp: $(PDIR)/sigrok/core/classes.i \
659 bindings/swig/classes.i bindings/swig/templates.i \
660 bindings/swig/enums.i $(PDOC_START) $(PDOC_END) \
661 $(library_include_HEADERS) \
662 $(nodist_library_include_HEADERS) \
663 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
664 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
665 @ORDER@ bindings/cxx/libsigrokcxx.la
666 $(AM_V_at)$(setup_py) clean --all 2>/dev/null
667 $(AM_V_GEN)$(setup_py) build_ext --swig "$(SWIG)" --swig-opts '$(swig_defs)' build_py
668 $(AM_V_at): >$@
669
670python-install:
671 $(AM_V_at)$(MKDIR_P) "$(DESTDIR)$(prefix)" "$(DESTDIR)$(exec_prefix)"
672 destdir='$(DESTDIR)'; $(setup_py) install $${destdir:+"--root=$$destdir"} \
673 --prefix "$(prefix)" --exec-prefix "$(exec_prefix)"
674
675python-clean:
676 -$(AM_V_at)rm -f $(PDIR)/timestamp
677 -$(AM_V_at)rm -fr $(PDIR)/doxy
678 -$(AM_V_at)$(setup_py) clean --all 2>/dev/null
679
680python-doc:
681 $(AM_V_at)cd $(srcdir)/$(PDIR) && BUILDDIR="$(abs_builddir)/$(PDIR)/" doxygen Doxyfile 2>/dev/null
682
683BUILD_EXTRA += python-build
684INSTALL_EXTRA += python-install
685CLEAN_EXTRA += python-clean
686
687endif
688
689if BINDINGS_RUBY
690
691RDIR = bindings/ruby
692RDOC = $(RDIR)/doc.i
693RWRAP = $(RDIR)/classes_wrap.cpp
694ROBJ = $(RWRAP:.cpp=.o)
695REXT = $(RDIR)/sigrok.$(RUBY_DLEXT)
696
697$(RDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
698 $(AM_V_at)test -d $(RDIR) || $(MKDIR_P) $(RDIR)
699 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py ruby $(CPPXMLDOC) > $@
700
701$(RWRAP): $(RDIR)/classes.i $(RDOC) \
702 bindings/swig/classes.i bindings/swig/templates.i \
703 bindings/swig/enums.i
704 $(AM_V_GEN)$(SWIG) -ruby -c++ -Ibindings -Ibindings/cxx/include -I$(RDIR) $(local_includes) $(swig_defs) -o $@ $<
705
706$(ROBJ): $(RWRAP) \
707 $(library_include_HEADERS) \
708 $(nodist_library_include_HEADERS) \
709 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
710 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
711 $(AM_V_CXX)$(CXX) $(RBSIGROK_CFLAGS) -I. -Iinclude -Ibindings/cxx/include $(local_includes) -fPIC -o $@ -c $<
712
713$(REXT): $(ROBJ) @ORDER@ bindings/cxx/libsigrokcxx.la
714 $(AM_V_CXXLD)$(CXX) -shared -o $@ $< -lsigrokcxx -Lbindings/cxx/.libs $(RBSIGROK_LIBS)
715
716ruby-build: $(REXT)
717
718ruby-install: $(REXT)
719 $(INSTALL) -d $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
720 $(INSTALL) $< $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)
721
722ruby-uninstall:
723 rm -f $(DESTDIR)$(prefix)/$(RBSIGROK_EXTDIR)/sigrok.$(RUBY_DLEXT)
724
725ruby-clean:
726 -$(AM_V_at)rm -fr $(RDIR)/doc
727 -$(AM_V_at)rm -f $(REXT) $(ROBJ) $(RWRAP) $(RDOC)
728
729ruby-doc: $(RWRAP)
730 $(AM_V_at)yard doc -o $(RDIR)/doc $<
731
732BUILD_EXTRA += ruby-build
733INSTALL_EXTRA += ruby-install
734UNINSTALL_EXTRA += ruby-uninstall
735CLEAN_EXTRA += ruby-clean
736
737endif
738
739if BINDINGS_JAVA
740
741JDIR = bindings/java
742JPKG = org/sigrok/core
743JCLS = $(JDIR)/$(JPKG)/classes
744JINT = $(JDIR)/$(JPKG)/interfaces
745JSRC = $(JCLS)/*.java $(srcdir)/$(JINT)/*.java
746JSWG = $(JCLS)/classes.i
747JDOC = $(JCLS)/doc.i
748JCXX = $(JCLS)/classes_wrap.cxx
749JLIB = $(JDIR)/libsigrok_java_core_classes.so
750JJAR = $(JDIR)/sigrok-core.jar
751
752java_cleanfiles = $(JCXX) $(JCLS)/*.java $(JCLS)/*.class $(JINT)/*.class $(JJAR) $(JLIB)
753
754java-build: $(JJAR) $(JLIB)
755
756$(JDOC): $(srcdir)/bindings/swig/doc.py $(CPPXMLDOC)
757 $(AM_V_at)test -d $(JCLS) || $(MKDIR_P) $(JCLS)
758 $(AM_V_GEN)$(PYTHON) $(srcdir)/bindings/swig/doc.py java $(CPPXMLDOC) > $@
759
760$(JCXX): $(srcdir)/$(JSWG) $(JDOC) bindings/swig/classes.i \
761 bindings/swig/templates.i bindings/swig/enums.i \
762 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
763 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS)
764 -$(AM_V_at)rm -f $(java_cleanfiles)
765 $(AM_V_GEN)$(SWIG) -c++ $(swig_defs) \
766 -java -package org.sigrok.core.classes \
767 -Ibindings -I$(JCLS) $(local_includes) -I$(srcdir) $(JNI_CPPFLAGS) \
768 -outdir $(JCLS) -o $@ $(srcdir)/$(JSWG)
769
770$(JJAR): $(JCXX)
771 $(AM_V_GEN)$(JAVAC) -d $(JDIR) $(JSRC)
772 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
773
774$(JLIB): $(JCXX) \
775 $(library_include_HEADERS) $(nodist_library_include_HEADERS) \
776 $(bindings_cxx_libsigrokcxx_la_include_HEADERS) \
777 $(nodist_bindings_cxx_libsigrokcxx_la_include_HEADERS) \
778 @ORDER@ bindings/cxx/libsigrokcxx.la
779 $(AM_V_GEN)$(CXXCOMPILE) $(JNI_CPPFLAGS) -L.libs -Lbindings/cxx/.libs \
780 -fno-strict-aliasing -fPIC -shared $(JCLS)/classes_wrap.cxx \
781 -lsigrokcxx $(LIBSIGROKCXX_LIBS) -o $(JLIB)
782
783java-install:
784 $(INSTALL) -d $(DESTDIR)$(libdir)/jni
785 $(INSTALL) $(JLIB) $(DESTDIR)$(libdir)/jni
786 $(INSTALL) -d $(DESTDIR)$(datadir)/java
787 $(INSTALL) $(JJAR) $(DESTDIR)$(datadir)/java
788
789java-uninstall:
790 -rm -f $(DESTDIR)$(datadir)/java/sigrok-core.jar
791 -rm -f $(DESTDIR)$(libdir)/jni/libsigrok_java_core_classes.so
792
793java-clean:
794 -$(AM_V_at)rm -f $(java_cleanfiles) $(JDOC)
795 -$(AM_V_at)rm -fr $(JDIR)/doxy
796
797java-doc:
798 $(AM_V_at)cd $(srcdir)/$(JDIR) && BUILDDIR="$(abs_builddir)/$(JDIR)/" doxygen Doxyfile
799
800BUILD_EXTRA += java-build
801INSTALL_EXTRA += java-install
802UNINSTALL_EXTRA += java-uninstall
803CLEAN_EXTRA += java-clean
804
805endif
806
807all-local: $(BUILD_EXTRA)
808install-exec-local: $(INSTALL_EXTRA)
809uninstall-local: $(UNINSTALL_EXTRA)
810clean-local: $(CLEAN_EXTRA)
811
812.PHONY: dist-changelog
813
814dist-hook: dist-changelog
815
816dist-changelog:
817 $(AM_V_at)if test ! -d '$(top_srcdir)/.git'; then \
818 cp -f '$(top_srcdir)/ChangeLog' "$(top_distdir)/ChangeLog"; \
819 elif git -C '$(top_srcdir)' log >.ChangeLog.tmp; then \
820 mv -f .ChangeLog.tmp "$(top_distdir)/ChangeLog"; \
821 else \
822 rm -f .ChangeLog.tmp; exit 1; \
823 fi
824