X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=Makefile.am;h=97e5228517357d15a959015d11cb27ff9f98c1b0;hp=c4a9d475fa9cbf6400759b3c4902f69ef8a17800;hb=3a67b032235e719dc4e74f735d1c95ef2d481a33;hpb=20e950feb2fea1c6c106ced44e1fef3cf6d882ef;ds=sidebyside diff --git a/Makefile.am b/Makefile.am index c4a9d47..97e5228 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,11 +14,23 @@ ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +## along with this program; if not, see . ## -ACLOCAL_AMFLAGS = -I autostuff +ACLOCAL_AMFLAGS = -I m4 +AM_LIBTOOLFLAGS = --silent +GNUMAKEFLAGS = --no-print-directory + +DECODERS_DIR = $(pkgdatadir)/decoders +# Do not hard-code the decoders location on Windows. +if WIN32 +AM_CPPFLAGS = +else +AM_CPPFLAGS = -DDECODERS_DIR='"$(DECODERS_DIR)"' +endif + +# The tests CFLAGS are a superset of the libsigrokdecode CFLAGS. +AM_CFLAGS = $(SRD_EXTRA_CFLAGS) $(SRD_WFLAGS) $(TESTS_CFLAGS) lib_LTLIBRARIES = libsigrokdecode.la @@ -32,53 +44,44 @@ libsigrokdecode_la_SOURCES = \ exception.c \ module_sigrokdecode.c \ type_decoder.c \ - type_logic.c \ error.c \ version.c -libsigrokdecode_la_CPPFLAGS = $(CPPFLAGS_PYTHON) \ - -DDECODERS_DIR='"$(DECODERS_DIR)"' -libsigrokdecode_la_LDFLAGS = $(SRD_LIB_LDFLAGS) $(LDFLAGS_PYTHON) +libsigrokdecode_la_LIBADD = $(SRD_EXTRA_LIBS) $(LIBSIGROKDECODE_LIBS) +libsigrokdecode_la_LDFLAGS = -version-info $(SRD_LIB_VERSION) -no-undefined -library_includedir = $(includedir)/libsigrokdecode -library_include_HEADERS = libsigrokdecode.h version.h +pkginclude_HEADERS = libsigrokdecode.h +nodist_pkginclude_HEADERS = version.h noinst_HEADERS = libsigrokdecode-internal.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsigrokdecode.pc -EXTRA_DIST = Doxyfile contrib/sigrok-logo-notext.png +EXTRA_DIST = Doxyfile HACKING contrib/sigrok-logo-notext.png if HAVE_CHECK -TESTS = tests/check_main +TESTS = tests/main check_PROGRAMS = ${TESTS} -tests_check_main_SOURCES = \ +endif + +tests_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 + tests/main.c \ + tests/core.c \ + tests/decoder.c \ + tests/inst.c \ + tests/session.c -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 +tests_main_CPPFLAGS = -DDECODERS_TESTDIR='"$(abs_top_srcdir)/decoders"' +tests_main_LDADD = libsigrokdecode.la $(SRD_EXTRA_LIBS) $(TESTS_LIBS) MAINTAINERCLEANFILES = ChangeLog -.PHONY: ChangeLog +.PHONY: ChangeLog install-decoders + ChangeLog: - git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog + git --git-dir '$(top_srcdir)/.git' log >$@ || touch $@ dist-hook: ChangeLog $(MKDIR_P) $(distdir)/tools @@ -89,8 +92,8 @@ dist-hook: ChangeLog install-decoders: $(MKDIR_P) $(DESTDIR)$(DECODERS_DIR) - ${top_srcdir}/tools/install-decoders -i ${top_srcdir}/decoders \ - -o $(DESTDIR)$(DECODERS_DIR) + $(PYTHON3) ${top_srcdir}/tools/install-decoders \ + -i ${top_srcdir}/decoders -o $(DESTDIR)$(DECODERS_DIR) install-data-hook: install-decoders