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