diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:53:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 06:53:20 +0000 |
commit | e5a812082ae033afb1eed82c0f2df3d0f6bdc93f (patch) | |
tree | a6716c9275b4b413f6c9194798b34b91affb3cc7 /mk | |
parent | Initial commit. (diff) | |
download | pacemaker-e5a812082ae033afb1eed82c0f2df3d0f6bdc93f.tar.xz pacemaker-e5a812082ae033afb1eed82c0f2df3d0f6bdc93f.zip |
Adding upstream version 2.1.6.upstream/2.1.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mk')
-rw-r--r-- | mk/common.mk | 40 | ||||
-rw-r--r-- | mk/man.mk | 71 | ||||
-rw-r--r-- | mk/release.mk | 87 | ||||
-rw-r--r-- | mk/tap.mk | 31 | ||||
-rw-r--r-- | mk/unittest.mk | 19 |
5 files changed, 248 insertions, 0 deletions
diff --git a/mk/common.mk b/mk/common.mk new file mode 100644 index 0000000..ac360cc --- /dev/null +++ b/mk/common.mk @@ -0,0 +1,40 @@ +# +# Copyright 2014-2021 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +# +# Some variables to help with silent rules +# https://www.gnu.org/software/automake/manual/html_node/Automake-silent_002drules-Option.html + +V ?= $(AM_DEFAULT_VERBOSITY) + +# When a make command is prefixed with one of the AM_V_* macros, it may also be +# desirable to suffix the command with this, to silence stdout. +PCMK_quiet = $(pcmk_quiet_$(V)) +pcmk_quiet_0 = >/dev/null +pcmk_quiet_1 = + +# AM_V_GEN is intended to be used in custom pattern rules, and replaces echoing +# the command used with a more concise line with "GEN" and the name of the file +# being generated. Our AM_V_* macros are similar but more descriptive. +AM_V_MAN = $(am__v_MAN_$(V)) +am__v_MAN_0 = @echo " MAN $@"; +am__v_MAN_1 = + +AM_V_SCHEMA = $(am__v_SCHEMA_$(V)) +am__v_SCHEMA_0 = @echo " SCHEMA $@"; +am__v_SCHEMA_1 = + +AM_V_BOOK = $(am__v_BOOK_$(V)) +am__v_BOOK_0 = @echo " BOOK $(@:%/_build=%): $(BOOK_FORMATS)"; +am__v_BOOK_1 = + +MAINTAINERCLEANFILES = Makefile.in + +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl diff --git a/mk/man.mk b/mk/man.mk new file mode 100644 index 0000000..51dd1e6 --- /dev/null +++ b/mk/man.mk @@ -0,0 +1,71 @@ +# +# Copyright 2014-2021 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +# +# Man page builders +# +# We have three types of man pages: +# - man pages for the tools +# - man pages for OCF agents +# - man pages for cluster properties used by daemons +# +# "BUILD_HELP" actually means "help2man is available", so it only controls the +# tool man pages, which are generated by help2man. The other man pages are +# generated via XSL transforms. +# + +if BUILD_HELP +man8_MANS = $(sbin_PROGRAMS:%=%.8) $(sbin_SCRIPTS:%=%.8) + +HELP2MAN_ARGS = -N --section 8 --name "Part of the Pacemaker cluster resource manager" + +# Some of our tools' help are just shell script invocations of another tool's +# help. Putting the real tool in MAN8DEPS helps detect when the wrapped help +# needs updating. +# +# @TODO Drop MAN8DEPS once we've moved all tool functionality to libpacemaker, +# and all wrappers are converted from shell scripts to C code. +%.8: % $(MAN8DEPS) + $(AM_V_at)chmod a+x $(abs_builddir)/$< + PATH=$(abs_builddir):$$PATH $(abs_builddir)/$< --version >/dev/null + if [ -f $(abs_srcdir)/$@.inc ]; then \ + PATH=$(abs_builddir):$$PATH $(abs_builddir)/$< --help-all >/dev/null; \ + else \ + PATH=$(abs_builddir):$$PATH $(abs_builddir)/$< --help >/dev/null; \ + fi + $(AM_V_MAN)if [ -f $(abs_srcdir)/$@.inc ]; then \ + PATH=$(abs_builddir):$$PATH $(HELP2MAN) $(HELP2MAN_ARGS) \ + -h --help-all \ + --no-discard-stderr \ + -i $(abs_srcdir)/$@.inc $(abs_builddir)/$< \ + | sed -f $(top_srcdir)/tools/fix-manpages > $@ ; \ + else \ + PATH=$(abs_builddir):$$PATH $(HELP2MAN) $(HELP2MAN_ARGS) \ + --no-discard-stderr \ + $(abs_builddir)/$< --output $@ ; \ + fi +endif + +# Save raw XML meta-data from daemon executables, for later conversion into man +# pages. (Note that more specific rules may override this for creating other +# types of XML files.) +%.xml: % + $(AM_V_at)$(abs_builddir)/$< metadata > $@ + +# Process the raw daemon and OCF agent meta-data output using our +# meta-data-to-docbook-XML tranform. +%.dbook: %.xml + $(AM_V_at)$(XSLTPROC) --nonet --novalid --stringparam man.name $* \ + $(DBOOK_OPTS) $(top_srcdir)/xml/ocf-meta2man.xsl \ + $(abs_builddir)/$< > $(abs_builddir)/$@ + +# Generate the actual man page for an OCF resource agent from the intermediate +# docbook XML. +%.7: %.dbook + $(AM_V_MAN)$(XSLTPROC) $(MANPAGE_XSLT) $(abs_builddir)/$< $(PCMK_quiet) diff --git a/mk/release.mk b/mk/release.mk new file mode 100644 index 0000000..7d7259c --- /dev/null +++ b/mk/release.mk @@ -0,0 +1,87 @@ +# +# Copyright 2008-2022 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +# Define variables related to release version and such + +COMMIT ?= HEAD + +# TAG defaults to DIST when in a source distribution instead of a git checkout, +# the tag name if COMMIT is tagged, and the full commit ID otherwise. +TAG ?= $(shell \ + T=$$(git describe --tags --exact-match '$(COMMIT)' 2>/dev/null); \ + [ -n "$${T}" ] && echo "$${T}" \ + || git log --pretty=format:%H -n 1 '$(COMMIT)' 2>/dev/null \ + || echo DIST) + +# If DIRTY=anything is passed to make, generated versions will end in ".mod" +# as long as there are uncommitted changes and COMMIT is not changed from the +# default. +DIRTY_EXT = $(shell [ -n "$(DIRTY)" ] \ + && [ "$(COMMIT)" == "HEAD" ] \ + && ! git diff-index --quiet HEAD -- 2>/dev/null \ + && echo .mod) + +# These can be used in case statements to avoid make interpreting parentheses +lparen = ( +rparen = ) + +# This will be empty if not in a git checkout +CHECKOUT = $(shell git rev-parse --git-dir 2>/dev/null) + +# VERSION is set by configure, but we allow some make targets to be run without +# running configure first, so set a reasonable default in that case. +VERSION ?= $(shell if [ -z "$(CHECKOUT)" ]; then \ + echo 0.0.0; \ + else \ + git tag -l \ + | sed -n -e 's/^\(Pacemaker-[0-9.]*\)$$/\1/p' \ + | sort -Vr | head -n 1; \ + fi) + +# What the git tag would be for configured VERSION (such as "Pacemaker-2.1.5") +LAST_RELEASE ?= Pacemaker-$(VERSION) + +# What the git tag would be for the release after the configured VERSION +# (LAST_RELEASE stripped of its -rc* suffix if present, or with minor-minor +# version bumped if not; this should be manually overriden when bumping +# the major or minor version) +NEXT_RELEASE ?= $(shell case "$(LAST_RELEASE)" in \ + *-rc*$(rparen) \ + echo $(LAST_RELEASE) | sed s:-rc.*:: ;; \ + *$(rparen) \ + echo $(LAST_RELEASE) | awk -F. \ + '/[0-9]+\./{$$3+=1;OFS=".";print $$1,$$2,$$3}' \ + ;; \ + esac) + +# We have two make targets for creating distributions: +# +# - "make dist" is automake's native functionality, based on the various +# dist/nodist make variables; it always uses the current sources +# +# - "make export" is a custom target based on "git archive" and relevant +# entries from .gitattributes; it defaults to current sources but can use any +# git tag +# +# Both targets use the same name for the result, though they generate different +# contents. +# +# The directory is named pacemaker-<version> when in a source distribution +# instead of a git checkout, pacemaker-<version_part_of_tag> for tagged +# commits, and pacemaker-<short_commit> otherwise. +top_distdir = $(PACKAGE)-$(shell \ + case $(TAG) in \ + DIST$(rparen) \ + [ -n "$(VERSION)" ] && echo "$(VERSION)" \ + || echo DIST;; \ + Pacemaker-*$(rparen) \ + echo '$(TAG)' | cut -c11-;; \ + *$(rparen) \ + git log --pretty=format:%h -n 1 '$(TAG)';; \ + esac)$(DIRTY_EXT) diff --git a/mk/tap.mk b/mk/tap.mk new file mode 100644 index 0000000..da67813 --- /dev/null +++ b/mk/tap.mk @@ -0,0 +1,31 @@ +# +# Copyright 2021-2022 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +AM_TESTS_ENVIRONMENT= \ + G_DEBUG=gc-friendly \ + MALLOC_CHECK_=2 \ + MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) +LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tests/tap-driver.sh +LOG_COMPILER = $(top_srcdir)/tests/tap-test +CLEANFILES = *.log *.trs + +WRAPPED = calloc \ + endgrent \ + fopen \ + getenv \ + getpid \ + getgrent \ + getpwnam_r \ + readlink \ + setenv \ + setgrent \ + strdup \ + uname \ + unsetenv +LDFLAGS_WRAP = $(foreach fn,$(WRAPPED),-Wl,--wrap=$(fn)) diff --git a/mk/unittest.mk b/mk/unittest.mk new file mode 100644 index 0000000..ea397f2 --- /dev/null +++ b/mk/unittest.mk @@ -0,0 +1,19 @@ +# +# Copyright 2022 the Pacemaker project contributors +# +# The version control history for this file may have further details. +# +# This source code is licensed under the GNU General Public License version 2 +# or later (GPLv2+) WITHOUT ANY WARRANTY. +# + +AM_CPPFLAGS = -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/lib/common + +AM_CFLAGS = -DPCMK__UNIT_TESTING + +AM_LDFLAGS = $(LDFLAGS_WRAP) + +LDADD = $(top_builddir)/lib/common/libcrmcommon_test.la \ + -lcmocka |