]> git.ipfire.org Git - thirdparty/kmod.git/blobdiff - Makefile.am
libkmod-module: check for NULL before accessing pointers
[thirdparty/kmod.git] / Makefile.am
index d9da17d91ecabb55ac7a2c4ebf1f01b9a39b6bb9..194e1115ae7008bdf418591e553f3f5fe169c3ae 100644 (file)
@@ -7,6 +7,7 @@ endif
 DISTCLEAN_LOCAL_HOOKS =
 EXTRA_DIST =
 CLEANFILES = $(BUILT_FILES)
+DISTCLEANFILES =
 BUILT_FILES =
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 AM_MAKEFLAGS = --no-print-directory
@@ -39,9 +40,9 @@ SED_PROCESS = \
 %.pc: %.pc.in Makefile
        $(SED_PROCESS)
 
-LIBKMOD_CURRENT=4
-LIBKMOD_REVISION=10
-LIBKMOD_AGE=2
+LIBKMOD_CURRENT=5
+LIBKMOD_REVISION=3
+LIBKMOD_AGE=3
 
 noinst_LTLIBRARIES = shared/libshared.la
 shared_libshared_la_SOURCES = \
@@ -51,6 +52,8 @@ shared_libshared_la_SOURCES = \
        shared/array.h \
        shared/hash.c \
        shared/hash.h \
+       shared/scratchbuf.c \
+       shared/scratchbuf.h \
        shared/strbuf.c \
        shared/strbuf.h \
        shared/util.c \
@@ -127,6 +130,13 @@ tools_kmod_SOURCES = \
        tools/modinfo.c tools/modprobe.c \
        tools/depmod.c tools/log.h tools/log.c \
        tools/static-nodes.c
+
+if BUILD_EXPERIMENTAL
+tools_kmod_SOURCES += \
+       tools/insert.c \
+       tools/remove.c
+endif
+
 tools_kmod_LDADD = \
        shared/libshared.la \
        libkmod/libkmod-internal.la
@@ -227,7 +237,12 @@ build-module-playground:
                cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \
                find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \
                fi
+if BUILD_MODULES
        $(MAKE) -C $(MODULE_PLAYGROUND)
+else
+       $(MAKE) -C $(MODULE_PLAYGROUND) FAKE_BUILD=1
+endif
+
 
 rootfs: build-module-playground
        $(CREATE_ROOTFS)
@@ -254,6 +269,7 @@ check-am: rootfs check-sysconfdir
 
 
 EXTRA_DIST += \
+       testsuite/module-playground/cache \
        testsuite/module-playground/dummy.sha1 \
        testsuite/module-playground/dummy.sha256 \
        testsuite/module-playground/Makefile \
@@ -270,6 +286,12 @@ EXTRA_DIST += \
        testsuite/module-playground/mod-loop-c.c \
        testsuite/module-playground/mod-loop-d.c \
        testsuite/module-playground/mod-loop-e.c \
+       testsuite/module-playground/mod-loop-f.c \
+       testsuite/module-playground/mod-loop-g.c \
+       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 \
        testsuite/module-playground/mod-loop.h \
        testsuite/module-playground/mod-simple.c \
        testsuite/module-playground/mod-simple-i386.ko \
@@ -308,6 +330,7 @@ testsuite_libtestsuite_la_LIBADD = -lrt
 TESTSUITE = \
        testsuite/test-hash \
        testsuite/test-array \
+       testsuite/test-scratchbuf \
        testsuite/test-strbuf \
        testsuite/test-init \
        testsuite/test-initstate \
@@ -317,6 +340,11 @@ TESTSUITE = \
        testsuite/test-dependencies testsuite/test-depmod \
        testsuite/test-list
 
+if BUILD_EXPERIMENTAL
+TESTSUITE += \
+       testsuite/test-tools
+endif
+
 check_PROGRAMS = $(TESTSUITE)
 TESTS = $(TESTSUITE)
 
@@ -330,6 +358,9 @@ testsuite_test_hash_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_array_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_array_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
+testsuite_test_scratchbuf_LDADD = $(TESTSUITE_LDADD)
+testsuite_test_scratchbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+
 testsuite_test_strbuf_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_strbuf_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
@@ -356,6 +387,11 @@ testsuite_test_depmod_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 testsuite_test_list_LDADD = $(TESTSUITE_LDADD)
 testsuite_test_list_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
 
+if BUILD_EXPERIMENTAL
+testsuite_test_tools_LDADD = $(TESTSUITE_LDADD)
+testsuite_test_tools_CPPFLAGS = $(TESTSUITE_CPPFLAGS)
+endif
+
 testsuite-distclean:
        $(RM) -r $(ROOTFS)
        $(RM) testsuite/stamp-rootfs
@@ -376,6 +412,8 @@ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 buildtest-TESTS:
        $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
 
+DISTCLEANFILES += $(DOLT_CLEANFILES)
+
 # ------------------------------------------------------------------------------
 # coverage
 # ------------------------------------------------------------------------------
@@ -426,9 +464,9 @@ kmod-coverity-%.tar.xz:
        cov-build --dir cov-int make -j 4
        tar caf $@ cov-int
 
-coverity-tar: kmod-coverity-$(shell git describe).tar.xz
+coverity-tar: kmod-coverity-$(shell git describe  2>/dev/null).tar.xz
 
-coverity-sync: kmod-coverity-$(shell git describe).tar.xz
+coverity-sync: kmod-coverity-$(shell git describe 2>/dev/null).tar.xz
        @echo "uploading coverity tarball"
        @curl --form token=$(COVERITY_KMOD_TOKEN) \
                --form email=lucas.de.marchi@gmail.com \
@@ -460,3 +498,13 @@ tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
 
 tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign
        kup put kmod-$(VERSION).tar.xz  kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/
+
+# ------------------------------------------------------------------------------
+# mkosi
+# ------------------------------------------------------------------------------
+
+DISTRO ?= "arch"
+
+mkosi:
+       -$(MKDIR_P) $(top_srcdir)/testsuite/mkosi/mkosi.cache
+       $(MKOSI) -C $(top_srcdir)/testsuite/mkosi --build-sources ../../ --default mkosi.${DISTRO} -fi