]> sigrok.org Git - libsigrokdecode.git/blobdiff - Makefile.am
Makefile.am: Add HACKING to the tarball.
[libsigrokdecode.git] / Makefile.am
index 5daf9d2a46726b7430e94afb015c77f0a94ca3db..5c88cc4fd145844e228ca328db420c572825aece 100644 (file)
@@ -1,5 +1,5 @@
 ##
-## This file is part of the sigrok project.
+## This file is part of the libsigrokdecode project.
 ##
 ## Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
 ##
 
 ACLOCAL_AMFLAGS = -I autostuff
 
-SUBDIRS = decoders
-
 lib_LTLIBRARIES = libsigrokdecode.la
 
-libsigrokdecode_la_SOURCES = controller.c decoder.c log.c util.c exception.c \
-       module_sigrokdecode.c type_decoder.c type_logic.c version.c
+libsigrokdecode_la_SOURCES = \
+       srd.c \
+       session.c \
+       decoder.c \
+       instance.c \
+       log.c \
+       util.c \
+       exception.c \
+       module_sigrokdecode.c \
+       type_decoder.c \
+       type_logic.c \
+       error.c \
+       version.c
 
 libsigrokdecode_la_CPPFLAGS = $(CPPFLAGS_PYTHON) \
-                             -DDECODERS_DIR='"$(DECODERS_DIR)"'
+       -DDECODERS_DIR='"$(DECODERS_DIR)"'
 libsigrokdecode_la_LDFLAGS = $(SRD_LIB_LDFLAGS) $(LDFLAGS_PYTHON)
 
-include_HEADERS = sigrokdecode.h
-noinst_HEADERS = sigrokdecode-internal.h
+library_includedir = $(includedir)/libsigrokdecode
+library_include_HEADERS = libsigrokdecode.h version.h
+noinst_HEADERS = libsigrokdecode-internal.h
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libsigrokdecode.pc
 
-EXTRA_DIST = Doxyfile
+EXTRA_DIST = Doxyfile HACKING contrib/sigrok-logo-notext.png
+
+if HAVE_CHECK
+TESTS = tests/check_main
+check_PROGRAMS = ${TESTS}
+tests_check_main_SOURCES = \
+       libsigrokdecode.h \
+       tests/lib.h \
+       tests/check_main.c \
+       tests/check_core.c \
+       tests/check_decoder.c \
+       tests/check_inst.c \
+       tests/check_session.c
+tests_check_main_CFLAGS = @check_CFLAGS@
+tests_check_main_LDADD = $(top_builddir)/libsigrokdecode.la @check_LIBS@
+tests_check_main_CPPFLAGS = $(CPPFLAGS_PYTHON) \
+       -DDECODERS_DIR='"$(abs_top_builddir)/decoders"'
+endif
+
+if BUILD_RUNTC
+noinst_PROGRAMS = tests/runtc
+tests_runtc_SOURCES = tests/runtc.c
+tests_runtc_CPPFLAGS = $(CPPFLAGS_PYTHON) $(LIBSIGROK_CFLAGS) \
+       -DDECODERS_DIR='"$(abs_top_builddir)/decoders"'
+tests_runtc_LDFLAGS = -L$(top_builddir) $(LIBSIGROK_LIBS) $(LDFLAGS_PYTHON) -lsigrokdecode
+endif
 
 MAINTAINERCLEANFILES = ChangeLog
 
 .PHONY: ChangeLog
 ChangeLog:
-       git --git-dir $(top_srcdir)/../.git log > ChangeLog || touch ChangeLog
+       git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog
 
 dist-hook: ChangeLog
+       $(MKDIR_P) $(distdir)/tools
+       cp ${top_srcdir}/tools/install-decoders $(distdir)/tools
+       $(MKDIR_P) $(distdir)/decoders
+       ${top_srcdir}/tools/install-decoders -i ${top_srcdir}/decoders \
+               -o $(distdir)/decoders
+
+install-decoders:
+       $(MKDIR_P) $(DESTDIR)$(DECODERS_DIR)
+       $(PYTHON3) ${top_srcdir}/tools/install-decoders \
+               -i ${top_srcdir}/decoders -o $(DESTDIR)$(DECODERS_DIR)
+
+install-data-hook: install-decoders