summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am10
-rw-r--r--lib/libavl/Makefile.am2
-rw-r--r--lib/libefi/Makefile.am2
-rw-r--r--lib/libicp/Makefile.am2
-rw-r--r--lib/libnvpair/Makefile.am3
-rw-r--r--lib/libshare/Makefile.am2
-rw-r--r--lib/libspl/Makefile.am9
-rw-r--r--lib/libtpool/Makefile.am2
-rw-r--r--lib/libunicode/Makefile.am2
-rw-r--r--lib/libuutil/Makefile.am3
-rw-r--r--lib/libzfs/Makefile.am3
-rw-r--r--lib/libzfs_core/Makefile.am3
-rw-r--r--lib/libzfsbootenv/Makefile.am3
-rw-r--r--lib/libzpool/Makefile.am2
-rw-r--r--lib/libzstd/Makefile.am2
-rw-r--r--lib/libzutil/Makefile.am2
16 files changed, 46 insertions, 6 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 685c7b669..db7a3fa31 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,9 +1,12 @@
# NB: GNU Automake Manual, Chapter 8.3.5: Libtool Convenience Libraries
# These nine libraries are intermediary build components.
SUBDIRS = libavl libicp libshare libspl libtpool libzstd
+CPPCHECKDIRS = libavl libicp libnvpair libshare libspl libtpool libunicode
+CPPCHECKDIRS += libuutil libzfs libzfs_core libzfsbootenv libzpool libzutil
if BUILD_LINUX
SUBDIRS += libefi
+CPPCHECKDIRS += libefi
endif
# libnvpair is installed as part of the final build product
@@ -23,7 +26,7 @@ DISTLIBS += libnvpair
# is only linked against by ztest and zdb and no stable ABI is provided.
ABILIBS = libnvpair libuutil libzfs_core libzfs libzfsbootenv
-PHONY = checkabi storeabi
+PHONY = checkabi storeabi cppcheck
checkabi: $(ABILIBS)
set -e ; for dir in $(ABILIBS) ; do \
$(MAKE) -C $$dir checkabi ; \
@@ -33,3 +36,8 @@ storeabi: $(ABILIBS)
set -e ; for dir in $(ABILIBS) ; do \
$(MAKE) -C $$dir storeabi ; \
done
+
+cppcheck: $(CPPCHECKDIRS)
+ set -e ; for dir in $(CPPCHECKDIRS) ; do \
+ $(MAKE) -C $$dir cppcheck ; \
+ done
diff --git a/lib/libavl/Makefile.am b/lib/libavl/Makefile.am
index 6087b1d2f..2e0a431c7 100644
--- a/lib/libavl/Makefile.am
+++ b/lib/libavl/Makefile.am
@@ -12,3 +12,5 @@ KERNEL_C = \
nodist_libavl_la_SOURCES = \
$(KERNEL_C)
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libefi/Makefile.am b/lib/libefi/Makefile.am
index fab6c8d47..b26f7a6dc 100644
--- a/lib/libefi/Makefile.am
+++ b/lib/libefi/Makefile.am
@@ -10,3 +10,5 @@ USER_C = \
libefi_la_SOURCES = $(USER_C)
libefi_la_LIBADD = $(LIBUUID_LIBS) $(ZLIB_LIBS)
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libicp/Makefile.am b/lib/libicp/Makefile.am
index 6d3c65ea3..0b87a988c 100644
--- a/lib/libicp/Makefile.am
+++ b/lib/libicp/Makefile.am
@@ -71,3 +71,5 @@ KERNEL_ASM = $(ASM_SOURCES_AS)
nodist_libicp_la_SOURCES = \
$(KERNEL_C) \
$(KERNEL_ASM)
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am
index 7840e099b..a3e1fa307 100644
--- a/lib/libnvpair/Makefile.am
+++ b/lib/libnvpair/Makefile.am
@@ -1,5 +1,4 @@
include $(top_srcdir)/config/Rules.am
-PHONY =
VPATH = \
$(top_srcdir)/module/nvpair \
@@ -42,5 +41,7 @@ endif
libnvpair_la_LDFLAGS += -version-info 3:0:0
+include $(top_srcdir)/config/CppCheck.am
+
# Library ABI
EXTRA_DIST = libnvpair.abi libnvpair.suppr
diff --git a/lib/libshare/Makefile.am b/lib/libshare/Makefile.am
index e730ee3be..7cef13c3d 100644
--- a/lib/libshare/Makefile.am
+++ b/lib/libshare/Makefile.am
@@ -23,3 +23,5 @@ USER_C += \
endif
libshare_la_SOURCES = $(USER_C)
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libspl/Makefile.am b/lib/libspl/Makefile.am
index fc4f27c64..d27932aff 100644
--- a/lib/libspl/Makefile.am
+++ b/lib/libspl/Makefile.am
@@ -55,3 +55,12 @@ libspl_la_LIBADD = \
libspl_assert.la
libspl_la_LIBADD += $(LIBCLOCK_GETTIME)
+
+include $(top_srcdir)/config/CppCheck.am
+
+# Override the default SOURCES which includes TARGET_CPU_ATOMIC_SOURCE
+# in order to always evaluate the generic asm-generic/atomic.c source.
+CPPCHECKSRC = $(USER_C) asm-generic/atomic.c
+cppcheck:
+ $(CPPCHECK) -j$(CPU_COUNT) $(CPPCHECKFLAGS) --force \
+ $(DEFAULT_INCLUDES) $(CPPCHECKSRC)
diff --git a/lib/libtpool/Makefile.am b/lib/libtpool/Makefile.am
index 22bfa4b23..aa8bde32f 100644
--- a/lib/libtpool/Makefile.am
+++ b/lib/libtpool/Makefile.am
@@ -7,3 +7,5 @@ USER_C = \
thread_pool_impl.h
libtpool_la_SOURCES = $(USER_C)
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libunicode/Makefile.am b/lib/libunicode/Makefile.am
index fa9dd359d..b82975f68 100644
--- a/lib/libunicode/Makefile.am
+++ b/lib/libunicode/Makefile.am
@@ -13,3 +13,5 @@ KERNEL_C = \
nodist_libunicode_la_SOURCES = \
$(KERNEL_C)
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libuutil/Makefile.am b/lib/libuutil/Makefile.am
index 5e7cf5419..16d502345 100644
--- a/lib/libuutil/Makefile.am
+++ b/lib/libuutil/Makefile.am
@@ -1,5 +1,4 @@
include $(top_srcdir)/config/Rules.am
-PHONY =
lib_LTLIBRARIES = libuutil.la
@@ -32,5 +31,7 @@ endif
libuutil_la_LDFLAGS += -version-info 3:0:0
+include $(top_srcdir)/config/CppCheck.am
+
# Library ABI
EXTRA_DIST = libuutil.abi libuutil.suppr
diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am
index cd80ef719..621021a12 100644
--- a/lib/libzfs/Makefile.am
+++ b/lib/libzfs/Makefile.am
@@ -1,5 +1,4 @@
include $(top_srcdir)/config/Rules.am
-PHONY =
VPATH = \
$(top_srcdir)/module/icp \
@@ -90,6 +89,8 @@ endif
libzfs_la_LDFLAGS += -version-info 4:0:0
+include $(top_srcdir)/config/CppCheck.am
+
# Library ABI
EXTRA_DIST = libzfs.abi libzfs.suppr
diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am
index 760caddde..67e554dc8 100644
--- a/lib/libzfs_core/Makefile.am
+++ b/lib/libzfs_core/Makefile.am
@@ -1,5 +1,4 @@
include $(top_srcdir)/config/Rules.am
-PHONY =
pkgconfig_DATA = libzfs_core.pc
@@ -30,5 +29,7 @@ endif
libzfs_core_la_LDFLAGS += -version-info 3:0:0
+include $(top_srcdir)/config/CppCheck.am
+
# Library ABI
EXTRA_DIST = libzfs_core.abi libzfs_core.suppr
diff --git a/lib/libzfsbootenv/Makefile.am b/lib/libzfsbootenv/Makefile.am
index 51ab48f54..984df0b8a 100644
--- a/lib/libzfsbootenv/Makefile.am
+++ b/lib/libzfsbootenv/Makefile.am
@@ -1,5 +1,4 @@
include $(top_srcdir)/config/Rules.am
-PHONY =
pkgconfig_DATA = libzfsbootenv.pc
@@ -34,5 +33,7 @@ endif
libzfsbootenv_la_LDFLAGS += -version-info 1:0:0
+include $(top_srcdir)/config/CppCheck.am
+
# Library ABI
EXTRA_DIST = libzfsbootenv.abi libzfsbootenv.suppr
diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am
index 7aa7e8098..04ef34ebf 100644
--- a/lib/libzpool/Makefile.am
+++ b/lib/libzpool/Makefile.am
@@ -235,3 +235,5 @@ if TARGET_CPU_POWERPC
vdev_raidz_math_powerpc_altivec.$(OBJEXT): CFLAGS += -maltivec
vdev_raidz_math_powerpc_altivec.l$(OBJEXT): CFLAGS += -maltivec
endif
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libzstd/Makefile.am b/lib/libzstd/Makefile.am
index df31d8b23..c9ed7e2aa 100644
--- a/lib/libzstd/Makefile.am
+++ b/lib/libzstd/Makefile.am
@@ -19,3 +19,5 @@ lib/zstd.l$(OBJEXT): CFLAGS += -fno-tree-vectorize -include $(top_srcdir)/module
zfs_zstd.$(OBJEXT): CFLAGS += -include $(top_srcdir)/module/zstd/include/zstd_compat_wrapper.h
zfs_zstd.l$(OBJEXT): CFLAGS += -include $(top_srcdir)/module/zstd/include/zstd_compat_wrapper.h
+
+include $(top_srcdir)/config/CppCheck.am
diff --git a/lib/libzutil/Makefile.am b/lib/libzutil/Makefile.am
index 9cfb0de05..2f0357e9f 100644
--- a/lib/libzutil/Makefile.am
+++ b/lib/libzutil/Makefile.am
@@ -50,3 +50,5 @@ libzutil_la_LIBADD += \
endif
libzutil_la_LIBADD += -lm $(LIBBLKID_LIBS) $(LIBUDEV_LIBS)
+
+include $(top_srcdir)/config/CppCheck.am