X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=Makefile.am;h=1a1074e25938e0c5941fca9ddb64c4b32874a09f;hp=0515e80b91bddd5af556c273886273ed0e99b7a8;hb=be93391b62b1575ad75db99bf25fef245b85f8b7;hpb=a654ef6e407f1f914a6ec9b104a5e4cf9b84524c diff --git a/Makefile.am b/Makefile.am index 0515e80..1a1074e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,10 +20,16 @@ ACLOCAL_AMFLAGS = -I m4 AM_LIBTOOLFLAGS = --silent -MAKEFLAGS = --no-print-directory +GNUMAKEFLAGS = --no-print-directory DECODERS_DIR = $(pkgdatadir)/decoders -AM_CPPFLAGS = -D_POSIX_C_SOURCE=200112L -DDECODERS_DIR='"$(DECODERS_DIR)"' +COMMON_DIR = $(pkgdatadir)/common +# Do not hard-code the decoders location on Windows. +if WIN32 +AM_CPPFLAGS = +else +AM_CPPFLAGS = -DDECODERS_DIR='"$(DECODERS_DIR)"' -DCOMMON_DIR='"$(COMMON_DIR)"' +endif # The tests CFLAGS are a superset of the libsigrokdecode CFLAGS. AM_CFLAGS = $(SRD_EXTRA_CFLAGS) $(SRD_WFLAGS) $(TESTS_CFLAGS) @@ -70,7 +76,7 @@ tests_main_SOURCES = \ tests/inst.c \ tests/session.c -tests_main_CPPFLAGS = -D_POSIX_C_SOURCE=200112L -DDECODERS_DIR='"$(abs_top_srcdir)/decoders"' +tests_main_CPPFLAGS = -DDECODERS_TESTDIR='"$(abs_top_srcdir)/decoders"' tests_main_LDADD = libsigrokdecode.la $(SRD_EXTRA_LIBS) $(TESTS_LIBS) MAINTAINERCLEANFILES = ChangeLog @@ -78,19 +84,25 @@ MAINTAINERCLEANFILES = 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 cp ${top_srcdir}/tools/install-decoders $(distdir)/tools + $(MKDIR_P) $(distdir)/common + cp -a ${top_srcdir}/common $(distdir) $(MKDIR_P) $(distdir)/decoders ${top_srcdir}/tools/install-decoders -i ${top_srcdir}/decoders \ -o $(distdir)/decoders +install-common: + $(MKDIR_P) $(DESTDIR)$(COMMON_DIR) + cp -a ${top_srcdir}/common $(DESTDIR)$(pkgdatadir) + 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 +install-data-hook: install-common install-decoders