]> sigrok.org Git - libsigrok.git/blame - Makefile.am
Update bindings to use new output API.
[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
155b680d 23AM_CPPFLAGS = -Isrc -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
340f6e7a 24
8a7b47cd 25lib_LTLIBRARIES = libsigrok.la
a1bb33af 26
67bd8055 27# Backend files
a695d6c0 28libsigrok_la_SOURCES = \
155b680d
BV
29 src/backend.c \
30 src/device.c \
31 src/session.c \
32 src/session_file.c \
33 src/session_driver.c \
34 src/drivers.c \
35 src/hwdriver.c \
36 src/trigger.c \
37 src/soft-trigger.c \
38 src/strutil.c \
39 src/log.c \
40 src/version.c \
41 src/error.c \
42 src/std.c
960a75e4 43
155b680d
BV
44# Input modules
45libsigrok_la_SOURCES += \
46 src/input/binary.c \
47 src/input/chronovu_la8.c \
48 src/input/csv.c \
49 src/input/input.c \
50 src/input/vcd.c \
51 src/input/wav.c
67bd8055 52
155b680d
BV
53# Output modules
54libsigrok_la_SOURCES += \
55 src/output/output.c \
56 src/output/analog.c \
57 src/output/ascii.c \
58 src/output/bits.c \
59 src/output/binary.c \
60 src/output/csv.c \
61 src/output/chronovu_la8.c \
62 src/output/gnuplot.c \
63 src/output/hex.c \
64 src/output/ols.c \
65 src/output/vcd.c
67bd8055 66
155b680d 67# SCPI support
67bd8055 68libsigrok_la_SOURCES += \
155b680d
BV
69 src/scpi/scpi.c \
70 src/scpi/scpi_tcp.c
67bd8055
UH
71if NEED_RPC
72libsigrok_la_SOURCES += \
155b680d
BV
73 src/scpi/scpi_vxi.c \
74 src/scpi/vxi_clnt.c \
75 src/scpi/vxi_xdr.c \
76 src/scpi/vxi.h
67bd8055
UH
77endif
78if NEED_SERIAL
79libsigrok_la_SOURCES += \
155b680d
BV
80 src/serial.c \
81 src/scpi/scpi_serial.c
67bd8055
UH
82endif
83if NEED_USB
84libsigrok_la_SOURCES += \
155b680d
BV
85 src/ezusb.c \
86 src/usb.c \
87 src/scpi/scpi_usbtmc_libusb.c
67bd8055
UH
88endif
89if NEED_VISA
90libsigrok_la_SOURCES += \
155b680d 91 src/scpi/scpi_visa.c
67bd8055
UH
92endif
93
155b680d
BV
94# Hardware (DMM chip parsers)
95libsigrok_la_SOURCES += \
96 src/dmm/es519xx.c \
97 src/dmm/fs9721.c \
98 src/dmm/fs9922.c \
99 src/dmm/m2110.c \
100 src/dmm/metex14.c \
101 src/dmm/rs9lcd.c
67bd8055
UH
102
103# Hardware drivers
104if HW_AGILENT_DMM
105libsigrok_la_SOURCES += \
155b680d
BV
106 src/hardware/agilent-dmm/api.c \
107 src/hardware/agilent-dmm/agilent-dmm.h \
108 src/hardware/agilent-dmm/sched.c
67bd8055 109endif
67bd8055
UH
110if HW_APPA_55II
111libsigrok_la_SOURCES += \
155b680d
BV
112 src/hardware/appa-55ii/protocol.h \
113 src/hardware/appa-55ii/protocol.c \
114 src/hardware/appa-55ii/api.c
67bd8055
UH
115endif
116if HW_ASIX_SIGMA
117libsigrok_la_SOURCES += \
155b680d
BV
118 src/hardware/asix-sigma/asix-sigma.h \
119 src/hardware/asix-sigma/asix-sigma.c
67bd8055
UH
120endif
121if HW_ATTEN_PPS3XXX
122libsigrok_la_SOURCES += \
155b680d
BV
123 src/hardware/atten-pps3xxx/protocol.h \
124 src/hardware/atten-pps3xxx/protocol.c \
125 src/hardware/atten-pps3xxx/api.c
67bd8055 126endif
bb993797
KA
127if HW_BEAGLELOGIC
128libsigrok_la_SOURCES += \
3db4b08b 129 src/hardware/beaglelogic/beaglelogic.h \
155b680d
BV
130 src/hardware/beaglelogic/protocol.h \
131 src/hardware/beaglelogic/protocol.c \
132 src/hardware/beaglelogic/api.c
bb993797 133endif
67bd8055
UH
134if HW_BRYMEN_BM86X
135libsigrok_la_SOURCES += \
155b680d
BV
136 src/hardware/brymen-bm86x/protocol.h \
137 src/hardware/brymen-bm86x/protocol.c \
138 src/hardware/brymen-bm86x/api.c
67bd8055
UH
139endif
140if HW_BRYMEN_DMM
141libsigrok_la_SOURCES += \
155b680d
BV
142 src/hardware/brymen-dmm/parser.c \
143 src/hardware/brymen-dmm/protocol.h \
144 src/hardware/brymen-dmm/protocol.c \
145 src/hardware/brymen-dmm/api.c
67bd8055
UH
146endif
147if HW_CEM_DT_885X
148libsigrok_la_SOURCES += \
155b680d
BV
149 src/hardware/cem-dt-885x/protocol.h \
150 src/hardware/cem-dt-885x/protocol.c \
151 src/hardware/cem-dt-885x/api.c
67bd8055
UH
152endif
153if HW_CENTER_3XX
154libsigrok_la_SOURCES += \
155b680d
BV
155 src/hardware/center-3xx/protocol.h \
156 src/hardware/center-3xx/protocol.c \
157 src/hardware/center-3xx/api.c
67bd8055 158endif
7b356712 159if HW_CHRONOVU_LA
67bd8055 160libsigrok_la_SOURCES += \
155b680d
BV
161 src/hardware/chronovu-la/protocol.h \
162 src/hardware/chronovu-la/protocol.c \
163 src/hardware/chronovu-la/api.c
67bd8055
UH
164endif
165if HW_COLEAD_SLM
166libsigrok_la_SOURCES += \
155b680d
BV
167 src/hardware/colead-slm/protocol.h \
168 src/hardware/colead-slm/protocol.c \
169 src/hardware/colead-slm/api.c
67bd8055
UH
170endif
171if HW_CONRAD_DIGI_35_CPU
172libsigrok_la_SOURCES += \
155b680d
BV
173 src/hardware/conrad-digi-35-cpu/protocol.h \
174 src/hardware/conrad-digi-35-cpu/protocol.c \
175 src/hardware/conrad-digi-35-cpu/api.c
67bd8055
UH
176endif
177if HW_DEMO
178libsigrok_la_SOURCES += \
155b680d 179 src/hardware/demo/demo.c
67bd8055
UH
180endif
181if HW_FLUKE_DMM
182libsigrok_la_SOURCES += \
155b680d
BV
183 src/hardware/fluke-dmm/fluke-dmm.h \
184 src/hardware/fluke-dmm/fluke.c \
185 src/hardware/fluke-dmm/api.c
67bd8055
UH
186endif
187if HW_FX2LAFW
188libsigrok_la_SOURCES += \
155b680d
BV
189 src/hardware/fx2lafw/protocol.h \
190 src/hardware/fx2lafw/protocol.c \
191 src/hardware/fx2lafw/api.c
67bd8055
UH
192endif
193if HW_GMC_MH_1X_2X
194libsigrok_la_SOURCES += \
155b680d
BV
195 src/hardware/gmc-mh-1x-2x/protocol.h \
196 src/hardware/gmc-mh-1x-2x/protocol.c \
197 src/hardware/gmc-mh-1x-2x/api.c
67bd8055
UH
198endif
199if HW_HAMEG_HMO
200libsigrok_la_SOURCES += \
155b680d
BV
201 src/hardware/hameg-hmo/protocol.h \
202 src/hardware/hameg-hmo/protocol.c \
203 src/hardware/hameg-hmo/api.c
67bd8055
UH
204endif
205if HW_HANTEK_DSO
206libsigrok_la_SOURCES += \
155b680d
BV
207 src/hardware/hantek-dso/dso.h \
208 src/hardware/hantek-dso/dso.c \
209 src/hardware/hantek-dso/api.c
67bd8055
UH
210endif
211if HW_IKALOGIC_SCANALOGIC2
212libsigrok_la_SOURCES += \
155b680d
BV
213 src/hardware/ikalogic-scanalogic2/protocol.h \
214 src/hardware/ikalogic-scanalogic2/protocol.c \
215 src/hardware/ikalogic-scanalogic2/api.c
67bd8055
UH
216endif
217if HW_IKALOGIC_SCANAPLUS
218libsigrok_la_SOURCES += \
155b680d
BV
219 src/hardware/ikalogic-scanaplus/protocol.h \
220 src/hardware/ikalogic-scanaplus/protocol.c \
221 src/hardware/ikalogic-scanaplus/api.c
67bd8055
UH
222endif
223if HW_KECHENG_KC_330B
224libsigrok_la_SOURCES += \
155b680d
BV
225 src/hardware/kecheng-kc-330b/protocol.h \
226 src/hardware/kecheng-kc-330b/protocol.c \
227 src/hardware/kecheng-kc-330b/api.c
67bd8055
UH
228endif
229if HW_LASCAR_EL_USB
230libsigrok_la_SOURCES += \
155b680d
BV
231 src/hardware/lascar-el-usb/protocol.h \
232 src/hardware/lascar-el-usb/protocol.c \
233 src/hardware/lascar-el-usb/api.c
67bd8055 234endif
8f4e922f
UH
235if HW_MANSON_HCS_3XXX
236libsigrok_la_SOURCES += \
155b680d
BV
237 src/hardware/manson-hcs-3xxx/protocol.h \
238 src/hardware/manson-hcs-3xxx/protocol.c \
239 src/hardware/manson-hcs-3xxx/api.c
8f4e922f 240endif
67bd8055
UH
241if HW_MIC_985XX
242libsigrok_la_SOURCES += \
155b680d
BV
243 src/hardware/mic-985xx/protocol.h \
244 src/hardware/mic-985xx/protocol.c \
245 src/hardware/mic-985xx/api.c
67bd8055 246endif
41b7bd01
MH
247if HW_MOTECH_LPS_30X
248libsigrok_la_SOURCES += \
155b680d
BV
249 src/hardware/motech-lps-30x/protocol.h \
250 src/hardware/motech-lps-30x/protocol.c \
251 src/hardware/motech-lps-30x/api.c
41b7bd01 252endif
67bd8055
UH
253if HW_NORMA_DMM
254libsigrok_la_SOURCES += \
155b680d
BV
255 src/hardware/norma-dmm/protocol.h \
256 src/hardware/norma-dmm/protocol.c \
257 src/hardware/norma-dmm/api.c
67bd8055 258endif
d4b38748 259if HW_OPENBENCH_LOGIC_SNIFFER
67bd8055 260libsigrok_la_SOURCES += \
155b680d
BV
261 src/hardware/openbench-logic-sniffer/protocol.h \
262 src/hardware/openbench-logic-sniffer/protocol.c \
263 src/hardware/openbench-logic-sniffer/api.c
67bd8055
UH
264endif
265if HW_RIGOL_DS
266libsigrok_la_SOURCES += \
155b680d
BV
267 src/hardware/rigol-ds/protocol.h \
268 src/hardware/rigol-ds/protocol.c \
269 src/hardware/rigol-ds/api.c
67bd8055
UH
270endif
271if HW_SALEAE_LOGIC16
272libsigrok_la_SOURCES += \
155b680d
BV
273 src/hardware/saleae-logic16/protocol.h \
274 src/hardware/saleae-logic16/protocol.c \
275 src/hardware/saleae-logic16/api.c
67bd8055
UH
276endif
277if HW_SERIAL_DMM
278libsigrok_la_SOURCES += \
155b680d
BV
279 src/hardware/serial-dmm/protocol.h \
280 src/hardware/serial-dmm/protocol.c \
281 src/hardware/serial-dmm/api.c
67bd8055
UH
282endif
283if HW_SYSCLK_LWLA
284libsigrok_la_SOURCES += \
155b680d
BV
285 src/hardware/sysclk-lwla/lwla.h \
286 src/hardware/sysclk-lwla/lwla.c \
287 src/hardware/sysclk-lwla/protocol.h \
288 src/hardware/sysclk-lwla/protocol.c \
289 src/hardware/sysclk-lwla/api.c
67bd8055
UH
290endif
291if HW_TELEINFO
292libsigrok_la_SOURCES += \
155b680d
BV
293 src/hardware/teleinfo/protocol.h \
294 src/hardware/teleinfo/protocol.c \
295 src/hardware/teleinfo/api.c
67bd8055 296endif
0acdd793
BV
297if HW_TESTO
298libsigrok_la_SOURCES += \
155b680d
BV
299 src/hardware/testo/protocol.h \
300 src/hardware/testo/protocol.c \
301 src/hardware/testo/api.c
0acdd793 302endif
67bd8055
UH
303if HW_TONDAJ_SL_814
304libsigrok_la_SOURCES += \
155b680d
BV
305 src/hardware/tondaj-sl-814/protocol.h \
306 src/hardware/tondaj-sl-814/protocol.c \
307 src/hardware/tondaj-sl-814/api.c
67bd8055
UH
308endif
309if HW_UNI_T_DMM
310libsigrok_la_SOURCES += \
155b680d
BV
311 src/hardware/uni-t-dmm/protocol.h \
312 src/hardware/uni-t-dmm/protocol.c \
313 src/hardware/uni-t-dmm/api.c
67bd8055
UH
314endif
315if HW_UNI_T_UT32X
316libsigrok_la_SOURCES += \
155b680d
BV
317 src/hardware/uni-t-ut32x/protocol.h \
318 src/hardware/uni-t-ut32x/protocol.c \
319 src/hardware/uni-t-ut32x/api.c
67bd8055
UH
320endif
321if HW_VICTOR_DMM
322libsigrok_la_SOURCES += \
155b680d
BV
323 src/hardware/victor-dmm/protocol.h \
324 src/hardware/victor-dmm/protocol.c \
325 src/hardware/victor-dmm/api.c
67bd8055
UH
326endif
327if HW_ZEROPLUS_LOGIC_CUBE
328libsigrok_la_SOURCES += \
155b680d
BV
329 src/hardware/zeroplus-logic-cube/analyzer.c \
330 src/hardware/zeroplus-logic-cube/analyzer.h \
331 src/hardware/zeroplus-logic-cube/gl_usb.h \
332 src/hardware/zeroplus-logic-cube/gl_usb.c \
333 src/hardware/zeroplus-logic-cube/protocol.h \
334 src/hardware/zeroplus-logic-cube/protocol.c \
335 src/hardware/zeroplus-logic-cube/api.c
67bd8055
UH
336endif
337
338libsigrok_la_LIBADD = $(LIBOBJS)
a1bb33af 339
6dddd902 340libsigrok_la_LDFLAGS = $(SR_LIB_LDFLAGS)
eeebceea 341
45c59c8b 342library_includedir = $(includedir)/libsigrok
63d0fb75
ML
343library_include_HEADERS = \
344 include/libsigrok/libsigrok.h \
345 include/libsigrok/proto.h \
346 include/libsigrok/version.h
155b680d 347noinst_HEADERS = src/libsigrok-internal.h
a1bb33af 348
8a7b47cd
UH
349pkgconfigdir = $(libdir)/pkgconfig
350pkgconfig_DATA = libsigrok.pc
d658e348 351
67bd8055
UH
352EXTRA_DIST = \
353 Doxyfile \
354 HACKING \
355 README.devices \
356 contrib/gnuplot_chronovu_la8.gpi \
357 contrib/gnuplot_rigol_ds1xx2.gpi \
358 contrib/gnuplot_usbeesx.gpi \
359 contrib/gnuplot_usbeedx8.gpi \
360 contrib/gnuplot_usbeedx16.gpi \
361 contrib/sigrok-logo-notext.png \
362 contrib/z60_libsigrok.rules
363
364if HAVE_CHECK
365
366TESTS = tests/check_main
367
368check_PROGRAMS = ${TESTS}
369
370tests_check_main_SOURCES = \
6592c369 371 include/libsigrok/libsigrok.h \
67bd8055
UH
372 tests/lib.c \
373 tests/lib.h \
374 tests/check_main.c \
375 tests/check_core.c \
376 tests/check_input_all.c \
377 tests/check_input_binary.c \
378 tests/check_output_all.c \
379 tests/check_strutil.c \
380 tests/check_version.c \
381 tests/check_driver_all.c
382
383tests_check_main_CFLAGS = @check_CFLAGS@
384
385tests_check_main_LDADD = $(top_builddir)/libsigrok.la @check_LIBS@
386
387endif
dd8b5f56 388
580ed400
ML
389BUILD_EXTRA =
390INSTALL_EXTRA =
391CLEAN_EXTRA =
392
c23c8659
ML
393if BINDINGS_CXX
394
395lib_LTLIBRARIES += bindings/cxx/libsigrokxx.la
396
397bindings_cxx_libsigrokxx_la_SOURCES = bindings/cxx/classes.cpp
398
d1785122 399bindings_cxx_libsigrokxx_la_LIBADD = libsigrok.la $(glibmm_LIBS)
c23c8659
ML
400
401bindings_cxx_libsigrokxx_la_LDFLAGS = $(SR_LIB_LDFLAGS)
402
403library_include_HEADERS += \
404 bindings/cxx/include/libsigrok/libsigrok.hpp \
405 bindings/cxx/include/libsigrok/enums.hpp
406
407pkgconfig_DATA += bindings/cxx/libsigrokxx.pc
408
580ed400 409bindings/cxx/libsigrok.xml: include/libsigrok/libsigrok.h
f2a189f0 410 $(AM_V_GEN)gccxml $(CFLAGS) -DGLIB_DISABLE_DEPRECATION_WARNINGS $< -fxml=$@
580ed400
ML
411
412bindings/cxx/enums.cpp: bindings/cxx/enums.timestamp
413
414bindings/cxx/include/libsigrok/enums.hpp: bindings/cxx/enums.timestamp
c23c8659 415
580ed400 416bindings/cxx/enums.timestamp: bindings/cxx/enums.py bindings/cxx/libsigrok.xml \
c23c8659 417 bindings/cxx/ConfigKey_methods.cpp bindings/cxx/QuantityFlag_methods.cpp
f2a189f0
BV
418 $(AM_V_GEN)python $<
419 $(AM_V_at)touch $@
c23c8659 420
580ed400
ML
421bindings/cxx/classes.lo: bindings/cxx/classes.cpp bindings/cxx/enums.cpp \
422 $(library_include_HEADERS)
c23c8659 423
580ed400
ML
424cxx-clean:
425 rm -f bindings/cxx/libsigrok.xml
426 rm -f bindings/cxx/enums.cpp
427 rm -f bindings/cxx/include/libsigrok/enums.hpp
428 rm -f bindings/cxx/enums.timestamp
c23c8659 429
580ed400
ML
430CLEAN_EXTRA += cxx-clean
431
432endif
f7740954
ML
433
434if BINDINGS_PYTHON
435
d1785122
ML
436PDIR = bindings/python
437
438python-build: $(PDIR)/timestamp
439
c26162ff
BV
440python-quietclean:
441 $(AM_V_at)python $(PDIR)/setup.py --quiet clean --all 3>&1 1>&2 2>&3 \
442 | grep -v "can.t clean it"; true
8eb10b62 443
580ed400 444$(PDIR)/timestamp: bindings/cxx/libsigrokxx.la $(PDIR)/sigrok/core/classes.i \
c26162ff
BV
445 $(library_include_HEADERS)
446 $(AM_V_at)$(MAKE) python-quietclean
447 $(AM_V_GEN)cd $(PDIR) && python setup.py --quiet build 3>&1 1>&2 2>&3 \
448 | grep -v "command line option.*Wstrict-prototypes"; true
f2a189f0 449 $(AM_V_at)touch $(PDIR)/timestamp
f7740954
ML
450
451python-install:
f2a189f0 452 cd $(PDIR) && python setup.py --quiet install --prefix $(prefix)
f7740954 453
c26162ff
BV
454python-clean:
455 $(AM_V_at)$(MAKE) python-quietclean
f2a189f0 456 $(AM_V_at)rm -f $(PDIR)/timestamp
f7740954
ML
457
458BUILD_EXTRA += python-build
459INSTALL_EXTRA += python-install
460CLEAN_EXTRA += python-clean
461
462endif
463
9fcf4d0b
ML
464if BINDINGS_JAVA
465
466JDIR = bindings/java
467JPKG = org/sigrok/core/classes
468JINT = $(JDIR)/$(JPKG)/classes.i
469JSRC = $(JDIR)/$(JPKG)/classes_wrap.cxx
470JLIB = $(JDIR)/libsigrok_java_core_classes.so
471JJAR = $(JDIR)/sigrok-core.jar
472
473java-build: $(JJAR) $(JLIB)
474
580ed400 475$(JSRC): $(JINT) bindings/swig/classes.i $(library_include_HEADERS)
f2a189f0 476 $(AM_V_GEN)swig -c++ -java -package org.sigrok.core.classes \
9fcf4d0b
ML
477 -Iinclude -Ibindings/cxx/include \
478 -outdir $(JDIR)/$(JPKG) $(JINT)
479
480$(JJAR): $(JSRC) $(JDIR)/$(JPKG)/*.java
f2a189f0
BV
481 $(AM_V_GEN)$(JAVAC) -sourcepath $(JDIR) $(JDIR)/$(JPKG)/*.java
482 $(AM_V_at)jar cf $(JJAR) -C $(JDIR) $(JPKG)
9fcf4d0b 483
580ed400 484$(JLIB): $(JSRC) bindings/cxx/libsigrokxx.la $(library_include_HEADERS)
f2a189f0 485 $(AM_V_GEN)$(CXX) $(CXXFLAGS) -L.libs -Lbindings/cxx/.libs \
9fcf4d0b
ML
486 -fno-strict-aliasing -fPIC -shared \
487 $(JDIR)/$(JPKG)/classes_wrap.cxx -lsigrokxx \
488 -o $(JLIB)
489
490java-install:
491 $(INSTALL) -d $(libdir)/jni
492 $(INSTALL) $(JLIB) -t $(libdir)/jni
493 $(INSTALL) -d $(datadir)/java
494 $(INSTALL) $(JJAR) -t $(datadir)/java
495
496java-clean:
d1785122
ML
497 rm -f $(JSRC)
498 rm -f $(JDIR)/$(JPKG)/*.class
499 rm -f $(JJAR)
500 rm -f $(JLIB)
9fcf4d0b
ML
501
502BUILD_EXTRA += java-build
503INSTALL_EXTRA += java-install
504CLEAN_EXTRA += java-clean
505
506endif
507
f7740954
ML
508all-local: $(BUILD_EXTRA)
509install-exec-local: $(INSTALL_EXTRA)
d1785122 510clean-local: $(CLEAN_EXTRA)
f7740954 511
c0958408 512MAINTAINERCLEANFILES = ChangeLog
0fc12d66
UH
513
514.PHONY: ChangeLog
515ChangeLog:
bd58d8f3 516 git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
0fc12d66
UH
517
518dist-hook: ChangeLog
519