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