2012-07-30 23:27:10 +07:00
|
|
|
|
SUBDIRS = . libkmod/docs
|
|
|
|
|
|
|
|
|
|
if BUILD_MANPAGES
|
|
|
|
|
SUBDIRS += man
|
|
|
|
|
endif
|
2012-01-09 13:20:55 +07:00
|
|
|
|
|
2012-01-25 11:44:45 +07:00
|
|
|
|
DISTCLEAN_LOCAL_HOOKS =
|
2011-12-03 02:53:54 +07:00
|
|
|
|
EXTRA_DIST =
|
2014-03-24 18:27:19 +07:00
|
|
|
|
CLEANFILES = $(BUILT_FILES)
|
2015-03-11 01:17:03 +07:00
|
|
|
|
DISTCLEANFILES =
|
2014-03-24 18:27:19 +07:00
|
|
|
|
BUILT_FILES =
|
2011-11-21 21:35:15 +07:00
|
|
|
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
|
|
|
|
AM_MAKEFLAGS = --no-print-directory
|
|
|
|
|
|
2014-12-05 07:49:13 +07:00
|
|
|
|
GCC_COLORS ?= 'yes'
|
|
|
|
|
export GCC_COLORS
|
|
|
|
|
|
2011-11-21 21:35:15 +07:00
|
|
|
|
AM_CPPFLAGS = \
|
|
|
|
|
-include $(top_builddir)/config.h \
|
2014-10-03 08:03:19 +07:00
|
|
|
|
-I$(top_srcdir) \
|
2011-11-21 21:35:15 +07:00
|
|
|
|
-DSYSCONFDIR=\""$(sysconfdir)"\" \
|
2011-12-24 10:45:22 +07:00
|
|
|
|
${zlib_CFLAGS}
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2015-01-03 01:32:03 +07:00
|
|
|
|
AM_CFLAGS = $(OUR_CFLAGS)
|
|
|
|
|
AM_LDFLAGS = $(OUR_LDFLAGS)
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2011-12-21 20:48:07 +07:00
|
|
|
|
SED_PROCESS = \
|
|
|
|
|
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
|
|
|
|
|
-e 's,@VERSION\@,$(VERSION),g' \
|
|
|
|
|
-e 's,@prefix\@,$(prefix),g' \
|
|
|
|
|
-e 's,@exec_prefix\@,$(exec_prefix),g' \
|
|
|
|
|
-e 's,@libdir\@,$(libdir),g' \
|
|
|
|
|
-e 's,@includedir\@,$(includedir),g' \
|
2020-09-09 02:59:20 +07:00
|
|
|
|
-e 's,@libzstd_CFLAGS\@,${libzstd_CFLAGS},g' \
|
|
|
|
|
-e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \
|
2011-12-24 20:58:30 +07:00
|
|
|
|
-e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
|
|
|
|
|
-e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
|
2011-12-24 10:45:22 +07:00
|
|
|
|
-e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
|
|
|
|
|
-e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
|
2019-02-13 22:27:51 +07:00
|
|
|
|
-e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \
|
|
|
|
|
-e 's,@libcrypto_LIBS\@,${libcrypto_LIBS},g' \
|
2011-12-21 20:48:07 +07:00
|
|
|
|
< $< > $@ || rm $@
|
|
|
|
|
|
|
|
|
|
%.pc: %.pc.in Makefile
|
|
|
|
|
$(SED_PROCESS)
|
|
|
|
|
|
2021-01-08 01:26:12 +07:00
|
|
|
|
# Rules for libtool versioning (from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html)
|
|
|
|
|
# 1. Start with version information of ‘0:0:0’ for each libtool library.
|
|
|
|
|
# 2. Update the version information only immediately before a public release of
|
|
|
|
|
# your software. More frequent updates are unnecessary, and only guarantee that
|
|
|
|
|
# the current interface number gets larger faster.
|
|
|
|
|
# 3. If the library source code has changed at all since the last update, then
|
|
|
|
|
# increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
|
|
|
|
|
# 4. If any interfaces have been added, removed, or changed since the last
|
|
|
|
|
# update, increment current, and set revision to 0.
|
|
|
|
|
# 5. If any interfaces have been added since the last public release, then
|
|
|
|
|
# increment age.
|
|
|
|
|
# 6. If any interfaces have been removed or changed since the last public
|
|
|
|
|
# release, then set age to 0.
|
2015-11-18 07:12:07 +07:00
|
|
|
|
LIBKMOD_CURRENT=5
|
2021-01-08 01:43:36 +07:00
|
|
|
|
LIBKMOD_REVISION=6
|
2015-11-18 07:12:07 +07:00
|
|
|
|
LIBKMOD_AGE=3
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2014-10-09 11:20:35 +07:00
|
|
|
|
noinst_LTLIBRARIES = shared/libshared.la
|
|
|
|
|
shared_libshared_la_SOURCES = \
|
2014-10-03 10:13:49 +07:00
|
|
|
|
shared/macro.h \
|
2014-10-03 10:22:36 +07:00
|
|
|
|
shared/missing.h \
|
|
|
|
|
shared/array.c \
|
|
|
|
|
shared/array.h \
|
2014-10-03 10:29:18 +07:00
|
|
|
|
shared/hash.c \
|
|
|
|
|
shared/hash.h \
|
2016-08-11 00:20:32 +07:00
|
|
|
|
shared/scratchbuf.c \
|
2017-02-24 09:26:54 +07:00
|
|
|
|
shared/scratchbuf.h \
|
2014-10-11 23:03:21 +07:00
|
|
|
|
shared/strbuf.c \
|
|
|
|
|
shared/strbuf.h \
|
2014-10-03 10:13:49 +07:00
|
|
|
|
shared/util.c \
|
2014-10-09 11:14:16 +07:00
|
|
|
|
shared/util.h
|
2011-12-27 21:26:51 +07:00
|
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
|
include_HEADERS = libkmod/libkmod.h
|
|
|
|
|
lib_LTLIBRARIES = libkmod/libkmod.la
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
libkmod_libkmod_la_SOURCES = \
|
2011-11-21 23:35:35 +07:00
|
|
|
|
libkmod/libkmod.h \
|
2013-07-05 02:13:11 +07:00
|
|
|
|
libkmod/libkmod-internal.h \
|
2011-11-22 14:38:28 +07:00
|
|
|
|
libkmod/libkmod.c \
|
2019-11-09 00:25:20 +07:00
|
|
|
|
libkmod/libkmod-builtin.c \
|
2011-11-22 14:42:09 +07:00
|
|
|
|
libkmod/libkmod-list.c \
|
2011-11-30 03:07:43 +07:00
|
|
|
|
libkmod/libkmod-config.c \
|
2011-12-01 00:23:28 +07:00
|
|
|
|
libkmod/libkmod-index.c \
|
|
|
|
|
libkmod/libkmod-index.h \
|
2011-12-17 01:08:53 +07:00
|
|
|
|
libkmod/libkmod-module.c \
|
2011-12-18 10:25:06 +07:00
|
|
|
|
libkmod/libkmod-file.c \
|
2013-01-16 15:52:01 +07:00
|
|
|
|
libkmod/libkmod-elf.c \
|
|
|
|
|
libkmod/libkmod-signature.c
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
|
EXTRA_DIST += libkmod/libkmod.sym
|
2014-10-08 09:23:11 +07:00
|
|
|
|
EXTRA_DIST += libkmod/README \
|
|
|
|
|
libkmod/COPYING testsuite/COPYING tools/COPYING COPYING
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2011-11-21 23:35:35 +07:00
|
|
|
|
libkmod_libkmod_la_LDFLAGS = $(AM_LDFLAGS) \
|
|
|
|
|
-version-info $(LIBKMOD_CURRENT):$(LIBKMOD_REVISION):$(LIBKMOD_AGE) \
|
|
|
|
|
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
|
2014-10-03 10:13:49 +07:00
|
|
|
|
libkmod_libkmod_la_DEPENDENCIES = \
|
2014-10-09 11:20:35 +07:00
|
|
|
|
shared/libshared.la \
|
2014-10-03 10:13:49 +07:00
|
|
|
|
${top_srcdir}/libkmod/libkmod.sym
|
|
|
|
|
libkmod_libkmod_la_LIBADD = \
|
2014-10-09 11:20:35 +07:00
|
|
|
|
shared/libshared.la \
|
2020-09-09 02:59:20 +07:00
|
|
|
|
${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2013-07-05 02:13:11 +07:00
|
|
|
|
noinst_LTLIBRARIES += libkmod/libkmod-internal.la
|
|
|
|
|
libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
|
|
|
|
|
libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
|
2012-01-11 01:22:59 +07:00
|
|
|
|
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
|
2013-07-05 02:13:11 +07:00
|
|
|
|
libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES)
|
|
|
|
|
libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD)
|
2012-01-11 01:22:59 +07:00
|
|
|
|
|
2011-11-21 21:35:15 +07:00
|
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
2011-11-21 23:35:35 +07:00
|
|
|
|
pkgconfig_DATA = libkmod/libkmod.pc
|
2011-12-21 20:48:07 +07:00
|
|
|
|
EXTRA_DIST += libkmod/libkmod.pc.in
|
|
|
|
|
CLEANFILES += libkmod/libkmod.pc
|
2011-11-21 21:35:15 +07:00
|
|
|
|
|
2013-07-30 13:47:19 +07:00
|
|
|
|
bashcompletiondir=@bashcompletiondir@
|
|
|
|
|
dist_bashcompletion_DATA = \
|
|
|
|
|
shell-completion/bash/kmod
|
|
|
|
|
|
2011-12-22 21:40:24 +07:00
|
|
|
|
install-exec-hook:
|
|
|
|
|
if test "$(libdir)" != "$(rootlibdir)"; then \
|
2011-12-23 10:59:31 +07:00
|
|
|
|
$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
|
2011-12-22 21:40:24 +07:00
|
|
|
|
so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
|
2016-05-02 21:38:24 +07:00
|
|
|
|
so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
|
2011-12-22 21:40:24 +07:00
|
|
|
|
ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
|
|
|
|
|
mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
uninstall-hook:
|
|
|
|
|
rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
|
|
|
|
|
|
2011-12-11 07:19:41 +07:00
|
|
|
|
if BUILD_TOOLS
|
2012-01-04 17:58:19 +07:00
|
|
|
|
bin_PROGRAMS = tools/kmod
|
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
noinst_SCRIPTS = \
|
|
|
|
|
tools/insmod tools/rmmod tools/lsmod \
|
|
|
|
|
tools/modprobe tools/modinfo tools/depmod
|
2011-12-22 11:33:36 +07:00
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
tools_kmod_SOURCES = \
|
|
|
|
|
tools/kmod.c tools/kmod.h tools/lsmod.c \
|
|
|
|
|
tools/rmmod.c tools/insmod.c \
|
|
|
|
|
tools/modinfo.c tools/modprobe.c \
|
|
|
|
|
tools/depmod.c tools/log.h tools/log.c \
|
|
|
|
|
tools/static-nodes.c
|
2015-06-07 09:26:31 +07:00
|
|
|
|
|
|
|
|
|
if BUILD_EXPERIMENTAL
|
|
|
|
|
tools_kmod_SOURCES += \
|
|
|
|
|
tools/insert.c \
|
|
|
|
|
tools/remove.c
|
|
|
|
|
endif
|
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
tools_kmod_LDADD = \
|
2014-10-09 11:20:35 +07:00
|
|
|
|
shared/libshared.la \
|
2014-10-03 10:13:49 +07:00
|
|
|
|
libkmod/libkmod-internal.la
|
2012-01-10 20:15:19 +07:00
|
|
|
|
|
2013-07-05 02:01:55 +07:00
|
|
|
|
${noinst_SCRIPTS}: tools/kmod
|
2012-01-10 20:15:19 +07:00
|
|
|
|
$(AM_V_GEN) ($(RM) $@; \
|
|
|
|
|
$(LN_S) $(notdir $<) $@)
|
2011-12-11 07:19:41 +07:00
|
|
|
|
endif
|
|
|
|
|
|
2014-03-24 18:27:19 +07:00
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# PYTHON BINDINGS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
CYTHON_FLAGS_VERBOSE_ =
|
|
|
|
|
CYTHON_FLAGS_VERBOSE_0 =
|
|
|
|
|
CYTHON_FLAGS_VERBOSE_1 = -v
|
|
|
|
|
CYTHON_FLAGS = $(CYTHON_FLAGS_VERBOSE_$(V))
|
|
|
|
|
AM_V_CYTHON = $(am__v_CYTHON_$(V))
|
|
|
|
|
am__v_CYTHON_ = $(am__v_CYTHON_$(AM_DEFAULT_VERBOSITY))
|
|
|
|
|
am__v_CYTHON_0 = @echo " CYTHON " $@;
|
|
|
|
|
|
|
|
|
|
.pyx.c:
|
|
|
|
|
$(AM_V_CYTHON)$(CYTHON) -o $@ $<
|
|
|
|
|
|
|
|
|
|
%.py: %.py.in Makefile
|
|
|
|
|
$(SED_PROCESS)
|
|
|
|
|
|
|
|
|
|
# Remove some warnings for generated code
|
|
|
|
|
PYTHON_NOWARN = -Wno-redundant-decls -Wno-shadow -Wno-strict-aliasing
|
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
CPYTHON_MODULE_CFLAGS = \
|
|
|
|
|
$(AM_CFLAGS) -DCPYTHON_COMPILING_IN_PYPY=0 \
|
|
|
|
|
$(PYTHON_NOWARN) $(PYTHON_CFLAGS) \
|
|
|
|
|
-fvisibility=default
|
2019-11-19 04:56:17 +07:00
|
|
|
|
# Filter -Wl,--no-undefined to fix build with python 3.8
|
|
|
|
|
comma = ,
|
|
|
|
|
CPYTHON_MODULE_LDFLAGS = $(subst -Wl$(comma)--no-undefined,,$(AM_LDFLAGS))
|
|
|
|
|
CPYTHON_MODULE_LDFLAGS += -module -avoid-version -shared
|
2014-03-24 18:27:19 +07:00
|
|
|
|
|
|
|
|
|
if BUILD_PYTHON
|
2014-10-03 10:13:49 +07:00
|
|
|
|
pkgpyexec_LTLIBRARIES = \
|
|
|
|
|
libkmod/python/kmod/kmod.la \
|
|
|
|
|
libkmod/python/kmod/list.la \
|
|
|
|
|
libkmod/python/kmod/module.la \
|
|
|
|
|
libkmod/python/kmod/_util.la
|
2014-03-24 18:27:19 +07:00
|
|
|
|
|
|
|
|
|
libkmod_python_kmod_kmod_la_SOURCES = libkmod/python/kmod/kmod.c
|
|
|
|
|
libkmod_python_kmod_kmod_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS)
|
|
|
|
|
libkmod_python_kmod_kmod_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS)
|
|
|
|
|
libkmod_python_kmod_kmod_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la
|
|
|
|
|
|
|
|
|
|
libkmod_python_kmod_list_la_SOURCES = libkmod/python/kmod/list.c
|
|
|
|
|
libkmod_python_kmod_list_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS)
|
|
|
|
|
libkmod_python_kmod_list_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS)
|
|
|
|
|
libkmod_python_kmod_list_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la
|
|
|
|
|
|
|
|
|
|
libkmod_python_kmod_module_la_SOURCES = libkmod/python/kmod/module.c
|
|
|
|
|
libkmod_python_kmod_module_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS)
|
|
|
|
|
libkmod_python_kmod_module_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS)
|
|
|
|
|
libkmod_python_kmod_module_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la
|
|
|
|
|
|
|
|
|
|
libkmod_python_kmod__util_la_SOURCES = libkmod/python/kmod/_util.c
|
|
|
|
|
libkmod_python_kmod__util_la_CFLAGS = $(CPYTHON_MODULE_CFLAGS)
|
|
|
|
|
libkmod_python_kmod__util_la_LDFLAGS = $(CPYTHON_MODULE_LDFLAGS)
|
|
|
|
|
libkmod_python_kmod__util_la_LIBADD = $(PYTHON_LIBS) libkmod/libkmod.la
|
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
BUILT_FILES += \
|
|
|
|
|
$(libkmod_python_kmod_kmod_la_SOURCES) \
|
|
|
|
|
$(libkmod_python_kmod_list_la_SOURCES) \
|
|
|
|
|
$(libkmod_python_kmod_module_la_SOURCES) \
|
|
|
|
|
$(libkmod_python_kmod__util_la_SOURCES)
|
2014-03-24 18:27:19 +07:00
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
dist_pkgpyexec_PYTHON = \
|
|
|
|
|
libkmod/python/kmod/error.py \
|
|
|
|
|
libkmod/python/kmod/__init__.py \
|
|
|
|
|
libkmod/python/kmod/version.py
|
2014-03-24 18:27:19 +07:00
|
|
|
|
|
|
|
|
|
BUILT_FILES += libkmod/python/kmod/version.py
|
|
|
|
|
|
|
|
|
|
endif
|
2012-01-25 11:44:45 +07:00
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# TESTSUITE
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
2015-02-03 07:26:06 +07:00
|
|
|
|
EXTRA_DIST += testsuite/populate-modules.sh
|
|
|
|
|
|
|
|
|
|
MODULE_PLAYGROUND = testsuite/module-playground
|
2012-05-24 09:04:44 +07:00
|
|
|
|
ROOTFS = testsuite/rootfs
|
2012-05-24 11:31:36 +07:00
|
|
|
|
ROOTFS_PRISTINE = $(top_srcdir)/testsuite/rootfs-pristine
|
2013-10-10 13:49:48 +07:00
|
|
|
|
CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) && \
|
2012-05-24 11:31:36 +07:00
|
|
|
|
cp -r $(ROOTFS_PRISTINE) $(ROOTFS) && \
|
2015-02-03 07:26:06 +07:00
|
|
|
|
find $(ROOTFS) -type d -exec chmod +w {} \; && \
|
2015-03-05 23:06:37 +07:00
|
|
|
|
find $(ROOTFS) -type f -name .gitignore -exec rm -f {} \; && \
|
2015-02-03 07:26:06 +07:00
|
|
|
|
$(top_srcdir)/testsuite/populate-modules.sh \
|
2021-01-30 09:28:38 +07:00
|
|
|
|
$(MODULE_PLAYGROUND) $(ROOTFS) $(top_builddir)/config.h ) && \
|
2015-02-03 14:17:49 +07:00
|
|
|
|
touch testsuite/stamp-rootfs
|
2015-02-03 07:26:06 +07:00
|
|
|
|
|
|
|
|
|
build-module-playground:
|
|
|
|
|
$(AM_V_GEN)if test "$(top_srcdir)" != "$(top_builddir)"; then \
|
|
|
|
|
$(RM) -rf testsuite/module-playground && \
|
|
|
|
|
cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \
|
|
|
|
|
find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \
|
|
|
|
|
fi
|
2015-06-01 01:38:47 +07:00
|
|
|
|
if BUILD_MODULES
|
2015-02-03 07:26:06 +07:00
|
|
|
|
$(MAKE) -C $(MODULE_PLAYGROUND)
|
2015-06-01 01:38:47 +07:00
|
|
|
|
else
|
|
|
|
|
$(MAKE) -C $(MODULE_PLAYGROUND) FAKE_BUILD=1
|
|
|
|
|
endif
|
|
|
|
|
|
2015-02-03 07:26:06 +07:00
|
|
|
|
|
|
|
|
|
rootfs: build-module-playground
|
2012-05-24 11:31:36 +07:00
|
|
|
|
$(CREATE_ROOTFS)
|
2015-02-03 07:26:06 +07:00
|
|
|
|
|
|
|
|
|
.PHONY: rootfs build-playground
|
2012-05-24 11:31:36 +07:00
|
|
|
|
|
|
|
|
|
$(ROOTFS): $(ROOTFS_PRISTINE)
|
|
|
|
|
$(CREATE_ROOTFS)
|
2012-05-11 10:04:59 +07:00
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
TESTSUITE_OVERRIDE_LIBS = \
|
|
|
|
|
testsuite/uname.la testsuite/path.la \
|
|
|
|
|
testsuite/init_module.la \
|
|
|
|
|
testsuite/delete_module.la
|
|
|
|
|
TESTSUITE_OVERRIDE_LIBS_LDFLAGS = \
|
|
|
|
|
avoid-version -module -shared -export-dynamic -rpath /nowhere -ldl
|
2012-01-25 07:04:46 +07:00
|
|
|
|
|
2020-08-01 23:02:22 +07:00
|
|
|
|
check-am: rootfs
|
2014-04-04 16:30:07 +07:00
|
|
|
|
|
2012-06-28 22:16:36 +07:00
|
|
|
|
|
2015-02-24 11:50:32 +07:00
|
|
|
|
EXTRA_DIST += \
|
2015-06-09 12:03:36 +07:00
|
|
|
|
testsuite/module-playground/cache \
|
2019-02-08 04:44:39 +07:00
|
|
|
|
testsuite/module-playground/dummy.pkcs7 \
|
2015-02-24 11:50:32 +07:00
|
|
|
|
testsuite/module-playground/dummy.sha1 \
|
|
|
|
|
testsuite/module-playground/dummy.sha256 \
|
|
|
|
|
testsuite/module-playground/Makefile \
|
|
|
|
|
testsuite/module-playground/Makefile.arch \
|
|
|
|
|
testsuite/module-playground/mod-fake-cciss.c \
|
|
|
|
|
testsuite/module-playground/mod-fake-hpsa.c \
|
|
|
|
|
testsuite/module-playground/mod-fake-scsi-mod.c \
|
|
|
|
|
testsuite/module-playground/mod-foo-a.c \
|
|
|
|
|
testsuite/module-playground/mod-foo-b.c \
|
|
|
|
|
testsuite/module-playground/mod-foo.c \
|
|
|
|
|
testsuite/module-playground/mod-foo-c.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-a.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-b.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-c.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-d.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-e.c \
|
2016-11-11 08:37:04 +07:00
|
|
|
|
testsuite/module-playground/mod-loop-f.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-g.c \
|
2017-02-22 16:41:58 +07:00
|
|
|
|
testsuite/module-playground/mod-loop-h.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-i.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-j.c \
|
|
|
|
|
testsuite/module-playground/mod-loop-k.c \
|
2015-02-24 11:50:32 +07:00
|
|
|
|
testsuite/module-playground/mod-loop.h \
|
|
|
|
|
testsuite/module-playground/mod-simple.c \
|
|
|
|
|
testsuite/module-playground/mod-simple-i386.ko \
|
|
|
|
|
testsuite/module-playground/mod-simple-sparc64.ko \
|
|
|
|
|
testsuite/module-playground/mod-simple-x86_64.ko \
|
|
|
|
|
testsuite/module-playground/README
|
2015-02-03 07:26:06 +07:00
|
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
|
check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS)
|
2012-01-25 07:04:46 +07:00
|
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
|
testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
2015-01-08 04:14:20 +07:00
|
|
|
|
testsuite_path_la_CPPFLAGS = $(AM_CPPFLAGS) \
|
|
|
|
|
-DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\"
|
2012-01-26 21:18:23 +07:00
|
|
|
|
testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
2012-01-25 11:44:45 +07:00
|
|
|
|
|
2012-01-27 01:10:41 +07:00
|
|
|
|
testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
2012-01-26 21:18:23 +07:00
|
|
|
|
testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
|
|
|
|
|
testsuite_init_module_la_SOURCES = testsuite/init_module.c \
|
2012-01-30 01:09:59 +07:00
|
|
|
|
testsuite/stripped-module.h
|
2013-07-05 02:13:11 +07:00
|
|
|
|
testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la
|
2012-01-25 11:44:45 +07:00
|
|
|
|
|
2012-01-26 00:13:45 +07:00
|
|
|
|
TESTSUITE_CPPFLAGS = $(AM_CPPFLAGS) \
|
2014-10-03 10:13:49 +07:00
|
|
|
|
-DTESTSUITE_ROOTFS=\"$(abs_top_builddir)/$(ROOTFS)/\" \
|
|
|
|
|
-DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\"
|
|
|
|
|
TESTSUITE_LDADD = \
|
|
|
|
|
testsuite/libtestsuite.la libkmod/libkmod-internal.la \
|
2014-10-09 11:20:35 +07:00
|
|
|
|
shared/libshared.la
|
2012-01-26 00:13:45 +07:00
|
|
|
|
|
2020-08-01 23:02:22 +07:00
|
|
|
|
if KMOD_SYSCONFDIR_NOT_ETC
|
|
|
|
|
TESTSUITE_CPPFLAGS += -DKMOD_SYSCONFDIR_NOT_ETC
|
|
|
|
|
endif
|
|
|
|
|
|
2012-01-26 21:18:23 +07:00
|
|
|
|
check_LTLIBRARIES += testsuite/libtestsuite.la
|
2014-10-03 10:13:49 +07:00
|
|
|
|
testsuite_libtestsuite_la_SOURCES = \
|
|
|
|
|
testsuite/testsuite.c testsuite/testsuite.h
|
|
|
|
|
testsuite_libtestsuite_la_DEPENDENCIES = \
|
|
|
|
|
$(ROOTFS) $(TESTSUITE_OVERRIDE_LIBS)
|
2012-01-26 00:13:45 +07:00
|
|
|
|
testsuite_libtestsuite_la_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-06-06 11:03:15 +07:00
|
|
|
|
testsuite_libtestsuite_la_LIBADD = -lrt
|
2012-01-09 13:20:55 +07:00
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
TESTSUITE = \
|
|
|
|
|
testsuite/test-hash \
|
2014-10-08 11:12:15 +07:00
|
|
|
|
testsuite/test-array \
|
2016-08-11 00:20:32 +07:00
|
|
|
|
testsuite/test-scratchbuf \
|
2014-10-14 04:42:01 +07:00
|
|
|
|
testsuite/test-strbuf \
|
2015-02-27 11:51:45 +07:00
|
|
|
|
testsuite/test-init \
|
|
|
|
|
testsuite/test-initstate \
|
|
|
|
|
testsuite/test-testsuite testsuite/test-loaded \
|
2014-10-03 10:13:49 +07:00
|
|
|
|
testsuite/test-modinfo testsuite/test-util testsuite/test-new-module \
|
|
|
|
|
testsuite/test-modprobe testsuite/test-blacklist \
|
2015-01-26 18:47:09 +07:00
|
|
|
|
testsuite/test-dependencies testsuite/test-depmod \
|
2015-06-07 09:26:31 +07:00
|
|
|
|
testsuite/test-list
|
|
|
|
|
|
|
|
|
|
if BUILD_EXPERIMENTAL
|
|
|
|
|
TESTSUITE += \
|
2015-03-07 20:32:53 +07:00
|
|
|
|
testsuite/test-tools
|
2015-06-07 09:26:31 +07:00
|
|
|
|
endif
|
2012-10-04 11:08:13 +07:00
|
|
|
|
|
2012-01-25 06:53:27 +07:00
|
|
|
|
check_PROGRAMS = $(TESTSUITE)
|
|
|
|
|
TESTS = $(TESTSUITE)
|
|
|
|
|
|
2014-10-03 10:13:49 +07:00
|
|
|
|
testsuite_test_testsuite_LDADD = \
|
2014-10-09 11:20:35 +07:00
|
|
|
|
testsuite/libtestsuite.la shared/libshared.la
|
2012-01-26 00:13:45 +07:00
|
|
|
|
testsuite_test_testsuite_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2014-06-06 12:22:43 +07:00
|
|
|
|
|
|
|
|
|
testsuite_test_hash_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_hash_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
|
|
|
|
|
2014-10-08 11:12:15 +07:00
|
|
|
|
testsuite_test_array_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_array_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
|
|
|
|
|
2016-08-11 00:20:32 +07:00
|
|
|
|
testsuite_test_scratchbuf_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_scratchbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
|
|
|
|
|
2014-10-14 04:42:01 +07:00
|
|
|
|
testsuite_test_strbuf_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_strbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
|
|
|
|
|
2012-02-04 09:29:09 +07:00
|
|
|
|
testsuite_test_init_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_init_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2015-02-27 11:51:45 +07:00
|
|
|
|
testsuite_test_initstate_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_initstate_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-04 09:29:09 +07:00
|
|
|
|
testsuite_test_loaded_LDADD = $(TESTSUITE_LDADD)
|
2012-01-26 03:16:45 +07:00
|
|
|
|
testsuite_test_loaded_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-04 09:29:09 +07:00
|
|
|
|
testsuite_test_modinfo_LDADD = $(TESTSUITE_LDADD)
|
2012-01-26 05:32:48 +07:00
|
|
|
|
testsuite_test_modinfo_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2013-11-18 13:32:45 +07:00
|
|
|
|
testsuite_test_util_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_util_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-04 09:29:09 +07:00
|
|
|
|
testsuite_test_new_module_LDADD = $(TESTSUITE_LDADD)
|
2012-01-30 00:43:19 +07:00
|
|
|
|
testsuite_test_new_module_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-08 10:40:00 +07:00
|
|
|
|
testsuite_test_modprobe_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_modprobe_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-23 12:56:58 +07:00
|
|
|
|
testsuite_test_blacklist_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_blacklist_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-02-23 12:56:59 +07:00
|
|
|
|
testsuite_test_dependencies_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_dependencies_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2012-10-04 11:08:13 +07:00
|
|
|
|
testsuite_test_depmod_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2015-01-26 18:47:09 +07:00
|
|
|
|
testsuite_test_list_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_list_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2015-06-07 09:26:31 +07:00
|
|
|
|
|
|
|
|
|
if BUILD_EXPERIMENTAL
|
2015-03-07 20:32:53 +07:00
|
|
|
|
testsuite_test_tools_LDADD = $(TESTSUITE_LDADD)
|
|
|
|
|
testsuite_test_tools_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
|
2015-06-07 09:26:31 +07:00
|
|
|
|
endif
|
2012-01-25 06:53:27 +07:00
|
|
|
|
|
2012-05-11 10:04:59 +07:00
|
|
|
|
testsuite-distclean:
|
2012-09-08 22:43:54 +07:00
|
|
|
|
$(RM) -r $(ROOTFS)
|
|
|
|
|
$(RM) testsuite/stamp-rootfs
|
2015-02-03 07:26:06 +07:00
|
|
|
|
$(MAKE) -C testsuite/module-playground/ clean
|
|
|
|
|
if test "$(top_srcdir)" != "$(top_builddir)"; then \
|
|
|
|
|
$(RM) -rf testsuite/module-playground; \
|
|
|
|
|
fi
|
2012-05-11 10:04:59 +07:00
|
|
|
|
|
|
|
|
|
DISTCLEAN_LOCAL_HOOKS += testsuite-distclean
|
2012-05-24 09:04:44 +07:00
|
|
|
|
EXTRA_DIST += testsuite/rootfs-pristine
|
2012-05-11 09:42:41 +07:00
|
|
|
|
|
2014-03-24 18:27:19 +07:00
|
|
|
|
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc --enable-python --sysconfdir=/etc \
|
2020-12-28 08:00:43 +07:00
|
|
|
|
--with-zlib --with-zstd --with-openssl \
|
2013-07-30 13:47:19 +07:00
|
|
|
|
--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir)
|
2012-01-16 09:42:28 +07:00
|
|
|
|
|
2012-01-25 11:44:45 +07:00
|
|
|
|
distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
|
2012-01-16 09:42:28 +07:00
|
|
|
|
|
2013-10-10 08:09:52 +07:00
|
|
|
|
buildtest-TESTS:
|
|
|
|
|
$(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
|
|
|
|
|
|
2015-01-08 04:17:15 +07:00
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# coverage
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# .PHONY so it always rebuilds it
|
|
|
|
|
.PHONY: coverage lcov-run lcov-report coverage-sync
|
|
|
|
|
|
|
|
|
|
# run lcov from scratch, always
|
|
|
|
|
coverage: all
|
|
|
|
|
$(MAKE) lcov-run
|
|
|
|
|
$(MAKE) lcov-report
|
|
|
|
|
|
|
|
|
|
coverage_dir = coverage
|
|
|
|
|
coverage_opts = --base-directory $(srcdir) --directory $(builddir) \
|
|
|
|
|
--rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
|
|
|
|
|
|
|
|
|
|
if ENABLE_COVERAGE
|
|
|
|
|
# reset run coverage tests
|
|
|
|
|
lcov-run:
|
|
|
|
|
@rm -rf $(coverage_dir)
|
|
|
|
|
lcov $(coverage_opts) --zerocounters
|
|
|
|
|
-$(MAKE) check
|
|
|
|
|
|
|
|
|
|
# generate report based on current coverage data
|
|
|
|
|
lcov-report:
|
|
|
|
|
$(MKDIR_P) $(coverage_dir)
|
|
|
|
|
lcov $(coverage_opts) --capture --no-external --ignore-errors graph \
|
|
|
|
|
| sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
|
|
|
|
|
lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
|
|
|
|
|
genhtml -t "kmod test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
|
|
|
|
|
@echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
lcov-run lcov-report:
|
|
|
|
|
echo "Need to reconfigure with --enable-coverage"
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
2015-02-25 22:45:02 +07:00
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# coverity
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
kmod-coverity-%.tar.xz:
|
|
|
|
|
rm -rf $< cov-int
|
2018-12-18 00:52:05 +07:00
|
|
|
|
./autogen.sh c --disable-python --disable-manpages
|
2015-02-25 22:45:02 +07:00
|
|
|
|
make clean
|
|
|
|
|
cov-build --dir cov-int make -j 4
|
|
|
|
|
tar caf $@ cov-int
|
|
|
|
|
|
2015-06-09 12:01:11 +07:00
|
|
|
|
coverity-tar: kmod-coverity-$(shell git describe 2>/dev/null).tar.xz
|
2015-02-25 22:45:02 +07:00
|
|
|
|
|
2015-06-09 12:01:11 +07:00
|
|
|
|
coverity-sync: kmod-coverity-$(shell git describe 2>/dev/null).tar.xz
|
2015-02-25 22:45:02 +07:00
|
|
|
|
@echo "uploading coverity tarball"
|
|
|
|
|
@curl --form token=$(COVERITY_KMOD_TOKEN) \
|
|
|
|
|
--form email=lucas.de.marchi@gmail.com \
|
|
|
|
|
--form file=@$< \
|
|
|
|
|
--form version="$(shell git describe)" \
|
|
|
|
|
--form description="" \
|
|
|
|
|
https://scan.coverity.com/builds?project=kmod
|
|
|
|
|
|
|
|
|
|
coverity-clean:
|
|
|
|
|
rm -rf kmod-coverity-*.tar.xz cov-int
|
|
|
|
|
|
2012-01-16 09:42:28 +07:00
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# custom release helpers
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
git-release:
|
|
|
|
|
head -1 NEWS | grep -q "kmod $(VERSION)"
|
|
|
|
|
git commit -a -m "kmod $(VERSION)"
|
|
|
|
|
git tag -m "kmod $(VERSION)" -s v$(VERSION)
|
|
|
|
|
git gc --prune=0
|
|
|
|
|
|
|
|
|
|
kmod-$(VERSION).tar.xz:
|
|
|
|
|
make distcheck
|
|
|
|
|
|
|
|
|
|
kmod-$(VERSION).tar.sign:
|
|
|
|
|
xz -d -c kmod-$(VERSION).tar.xz | gpg --armor --detach-sign --output kmod-$(VERSION).tar.sign
|
|
|
|
|
|
|
|
|
|
tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
|
|
|
|
|
|
|
|
|
|
tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
|
2012-02-24 10:58:20 +07:00
|
|
|
|
kup put kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/
|
2018-01-03 05:08:03 +07:00
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# mkosi
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
2018-01-04 02:19:02 +07:00
|
|
|
|
DISTRO ?= "arch"
|
|
|
|
|
|
2018-01-03 05:08:03 +07:00
|
|
|
|
mkosi:
|
2018-01-03 09:17:51 +07:00
|
|
|
|
-$(MKDIR_P) $(top_srcdir)/testsuite/mkosi/mkosi.cache
|
2018-01-04 02:19:02 +07:00
|
|
|
|
$(MKOSI) -C $(top_srcdir)/testsuite/mkosi --build-sources ../../ --default mkosi.${DISTRO} -fi
|