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