]> sigrok.org Git - libsigrokdecode.git/blobdiff - Makefile.am
Add common directory for shared modules.
[libsigrokdecode.git] / Makefile.am
index 0515e80b91bddd5af556c273886273ed0e99b7a8..1a1074e25938e0c5941fca9ddb64c4b32874a09f 100644 (file)
 
 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