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