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