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