diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
commit | 07d7f4cfa4b10de87a31b68191036ff446add675 (patch) | |
tree | 7162524d8aaf1aef62d2f4fa51f595ed113981ff /devel/Makefile.am | |
parent | Adding upstream version 2.1.6. (diff) | |
download | pacemaker-0d560556df519c6626cda7660f843a815b3c227e.tar.xz pacemaker-0d560556df519c6626cda7660f843a815b3c227e.zip |
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devel/Makefile.am')
-rw-r--r-- | devel/Makefile.am | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/devel/Makefile.am b/devel/Makefile.am index 94581e1..b50f097 100644 --- a/devel/Makefile.am +++ b/devel/Makefile.am @@ -35,10 +35,12 @@ COCCI_FILES ?= coccinelle/string-any-of.cocci \ dist_noinst_SCRIPTS = coccinelle/test/testrunner.sh -EXTRA_DIST = README gdbhelpers $(COCCI_FILES) \ - coccinelle/ref-passed-variables-inited.cocci \ - coccinelle/rename-fn.cocci \ - coccinelle/test/ref-passed-variables-inited.input.c \ +EXTRA_DIST = README \ + gdbhelpers \ + $(COCCI_FILES) \ + coccinelle/ref-passed-variables-inited.cocci \ + coccinelle/rename-fn.cocci \ + coccinelle/test/ref-passed-variables-inited.input.c \ coccinelle/test/ref-passed-variables-inited.output # Any file in this list is allowed to use any of the pcmk__ internal functions. @@ -51,6 +53,7 @@ MAY_USE_INTERNAL_FILES = $(shell find .. -path "../lib/*.c" -o -path "../lib/*pr # may be applied. OTHER_FILES = $(shell find ../include -name '*h' -a \! -name '*internal.h' -a \! -path '../include/pcmki/*') +.PHONY: cocci cocci: -for cf in $(COCCI_FILES); do \ for f in $(MAY_USE_INTERNAL_FILES); do \ @@ -61,9 +64,11 @@ cocci: done ; \ done +.PHONY: cocci-inplace cocci-inplace: $(MAKE) $(AM_MAKEFLAGS) _SPATCH_FLAGS=--in-place cocci +.PHONY: cocci-test cocci-test: for f in coccinelle/test/*.c; do \ coccinelle/test/testrunner.sh $$f; \ @@ -78,6 +83,7 @@ cocci-test: # See scan-build(1) for possible checkers (leave empty to use default set) CLANG_checkers ?= +.PHONY: clang clang: OUT=$$(cd $(top_builddir) \ && scan-build $(CLANG_checkers:%=-enable-checker %) \ @@ -158,6 +164,8 @@ coverity-clean: ## cppcheck +GLIB_CFLAGS ?= $(pkg-config --cflags glib-2.0) + # Use CPPCHECK_ARGS to pass extra cppcheck options, e.g.: # --enable={warning,style,performance,portability,information,all} # --inconclusive --std=posix @@ -167,6 +175,7 @@ CPPCHECK_ARGS ?= CPPCHECK_DIRS = replace lib daemons tools CPPCHECK_OUT = $(abs_top_builddir)/cppcheck.out +.PHONY: cppcheck cppcheck: cppcheck $(CPPCHECK_ARGS) -I $(top_srcdir)/include \ --output-file=$(CPPCHECK_OUT) \ @@ -191,21 +200,26 @@ COVERAGE_DIR = $(top_builddir)/coverage .PHONY: coverage coverage: coverage-partial-clean cd $(top_builddir) \ - && $(MAKE) $(AM_MAKEFLAGS) core \ + && $(MAKE) $(AM_MAKEFLAGS) \ && lcov --no-external --exclude='*_test.c' -c -i -d . \ -o pacemaker_base.info \ && $(MAKE) $(AM_MAKEFLAGS) check \ && lcov --no-external --exclude='*_test.c' -c -d . \ -o pacemaker_test.info \ && lcov -a pacemaker_base.info -a pacemaker_test.info \ - -o pacemaker_total.info - genhtml $(top_builddir)/pacemaker_total.info -o $(COVERAGE_DIR) -s + -o pacemaker_total.info \ + && lcov --remove pacemaker_total.info -o pacemaker_filtered.info\ + "$(abs_top_builddir)/tools/*" \ + "$(abs_top_builddir)/daemons/*/*" \ + "$(abs_top_builddir)/replace/*" \ + "$(abs_top_builddir)/lib/gnu/*" + genhtml $(top_builddir)/pacemaker_filtered.info -o $(COVERAGE_DIR) -s -t "Pacemaker code coverage" # Check coverage of CLI regression tests .PHONY: coverage-cts coverage-cts: coverage-partial-clean cd $(top_builddir) \ - && $(MAKE) $(AM_MAKEFLAGS) core \ + && $(MAKE) $(AM_MAKEFLAGS) \ && lcov --no-external -c -i -d tools -o pacemaker_base.info \ && cts/cts-cli \ && lcov --no-external -c -d tools -o pacemaker_test.info \ @@ -277,6 +291,7 @@ INDENT_PACEMAKER_STYLE = --blank-lines-after-declarations \ --swallow-optional-blank-lines \ --tab-size8 +.PHONY: indent indent: VERSION_CONTROL=none \ find $(INDENT_DIRS) -type f -name "*.[ch]" \ @@ -284,6 +299,30 @@ indent: -exec indent $(INDENT_PACEMAKER_STYLE) $(INDENT_OPTS) \{\} \; # +# Check whether copyrights have been updated appropriately +# (Set COMMIT to desired commit or commit range to check, defaulting to HEAD, +# or set it empty to check uncommitted changes) +# +YEAR = $(shell date +%Y) +MODIFIED_FILES = $(shell case "$(COMMIT)" in \ + [0-9a-f]*$(rparen) \ + git diff-tree --no-commit-id \ + --name-only "$(COMMIT)" -r ;; \ + *$(rparen) \ + cd "$(top_srcdir)"; \ + git ls-files --modified ;; \ + esac) + +.PHONY: copyright +copyright: + @cd "$(top_srcdir)" && for file in $(MODIFIED_FILES); do \ + if ! grep 'opyright .*$(YEAR).* Pacemaker' "$$file" \ + >/dev/null 2>&1; then \ + echo "$$file"; \ + fi; \ + done + +# # Scratch file for ad-hoc testing # @@ -291,5 +330,6 @@ EXTRA_PROGRAMS = scratch nodist_scratch_SOURCES = scratch.c scratch_LDADD = $(top_builddir)/lib/common/libcrmcommon.la +.PHONY: clean-local clean-local: coverage-clean coverity-clean cppcheck-clean -rm -f $(EXTRA_PROGRAMS) |