GNUMAKEFLAGS = --no-print-directory
DECODERS_DIR = $(pkgdatadir)/decoders
-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)"'
+AM_CPPFLAGS = -DDECODERS_DIR='"$(DECODERS_DIR)"'
endif
# The tests CFLAGS are a superset of the libsigrokdecode CFLAGS.
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-common install-decoders
+install-data-hook: install-decoders
}
}
#ifdef DECODERS_DIR
- /* Common modules for use by any decoder. */
- if ((ret = srd_decoder_searchpath_add(COMMON_DIR)) != SRD_OK) {
- Py_Finalize();
- return ret;
- }
-
/* Hardcoded decoders install location, if defined. */
if ((ret = srd_decoder_searchpath_add(DECODERS_DIR)) != SRD_OK) {
Py_Finalize();
from getopt import getopt
-def install(srcdir, dstdir):
+def install(srcdir, dstdir, s):
worklist = []
for pd in os.listdir(srcdir):
pd_dir = srcdir + '/' + pd
install_list.extend(config_get_extra_install(pd_file))
elif f[-3:] == '.py':
install_list.append(f)
- worklist.append((pd, pd_dir, install_list))
+ if install_list:
+ worklist.append((pd, pd_dir, install_list))
- print("Installing %d protocol decoders:" % len(worklist))
+ print("Installing %d %s:" % (len(worklist), s))
col = 0
for pd, pd_dir, install_list in worklist:
msg = pd + ' '
if len(args) != 0 or dst is None:
usage()
-install(src, dst)
+install(src, dst, 'protocol decoders')
+install(src + '/common', dst + '/common', 'common modules')