diff --git a/.gitignore b/.gitignore index 26991a7786..bc2e70a1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ Makefile.in /missing /test-driver *-spellchecked +*-prepped *.adoc-parsed *.adoc*.tmp *.txt*.tmp diff --git a/Makefile.am b/Makefile.am index e7f9210e98..bac4f8eb2b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -74,11 +74,11 @@ DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \ --with-pynut=app --with-nut_monitor=force distcheck-light: - $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck + +$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck # Make a distcheck (and check in particular) with enabled valgrind and debug info memcheck distcheck-valgrind: - $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck + +$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck # workaround the dist generated files that are also part of the distribution # Note that distcleancheck is disabled for now, while waiting for a proper @@ -126,10 +126,10 @@ maintainer-clean-local: # should be available during their clean-up). Just in case, we make sure # here that their sub-distcleans complete first. distclean-local: - @for DIR in $(SUBDIRS) ; do \ + +@for DIR in $(SUBDIRS) ; do \ if test -f "$${DIR}/Makefile" ; then \ echo " DISTCLEAN in $${DIR}" >&2 ; \ - ( cd "$${DIR}" && $(MAKE) -s distclean ) || exit ; \ + ( cd "$${DIR}" && $(MAKE) $(AM_MAKEFLAGS) -s distclean ) || exit ; \ fi ; \ done $(AM_V_at)rm -rf .inst tmp autom4te.cache @@ -137,23 +137,27 @@ distclean-local: # Hook the documentation building and validating recipes # Note: these are optionally available (as determined during configure runs) +# Maint: grep -l 'SPELLCHECK_' `git grep -lw spellcheck '*.am'` spellcheck spellcheck-interactive: - @RES=0; \ - (cd $(builddir)/docs && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/docs/man && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/conf && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/data && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/data/html && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/Solaris && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/Windows && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/devd && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/hotplug && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/python && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/systemd && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/udev && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/scripts/upsdrvsvcctl && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/tests/NIT && $(MAKE) -s $@) || RES=$$? ; \ + +@RES=0; \ + (cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \ + (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \ + (cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/conf && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/data && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/data/html && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/Solaris && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/Windows && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/devd && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/hotplug && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/installer && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/python && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/systemd && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/udev && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/upsdrvsvcctl && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/tests/NIT && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ exit $$RES # Note: the "all-docs" and "check-docs" targets may require tools not @@ -164,10 +168,10 @@ spellcheck spellcheck-interactive: doc spellcheck-sortdict \ all-docs check-docs \ man all-man man-man check-man man-html all-html: - cd $(builddir)/docs && $(MAKE) $@ + +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@ INSTALL.nut UPGRADING NEWS README: - cd $(builddir)/docs && $(MAKE) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F) + +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F) # Workarounds for https://github.com/github/markup/issues/1095 # require direct definition of our attributes in each source @@ -223,7 +227,7 @@ maintainer-asciidocs: ) check-NIT check-NIT-devel: - cd $(builddir)/tests/NIT && $(MAKE) $@ + +cd $(builddir)/tests/NIT && $(MAKE) $(AM_MAKEFLAGS) $@ # This target adds syntax-checking for committed shell script files, # to avoid surprises and delays in finding fatal typos after packaging @@ -297,7 +301,7 @@ cppcheck: endif !HAVE_CPPCHECK sockdebug: - cd $(builddir)/server && $(MAKE) $(AM_MAKEFLAGS) sockdebug$(EXEEXT) + +cd $(builddir)/server && $(MAKE) $(AM_MAKEFLAGS) sockdebug$(EXEEXT) # ---------------------------------------------------------------------- # Automatically generate the ChangeLog from Git logs: @@ -313,18 +317,29 @@ GITLOG_START_POINT=v2.6.0 # Force ChangeLog regeneration upon make dist (due to nonexistant 'dummy-stamp'), # in case it has already been generated previously -# Note that the script is hard-coded to generate "ChangeLog" in the current dir +# Note that the script is hard-coded to inspect Git workspace which contains +# the current dir, and defaults to generate a "ChangeLog" in the current dir. +# The script itself is generated from a template, so resides in builddir. dummy-stamp: ChangeLog: tools/gitlog2changelog.py dummy-stamp - cd $(top_builddir) && \ - ./tools/gitlog2changelog.py $(GITLOG_START_POINT) || \ - { echo "gitlog2changelog.py failed to generate the ChangeLog. See https://github.com/networkupstools/nut/commits/master" > $@ ; } + cd $(abs_top_srcdir) && \ + if test -e .git ; then \ + CHANGELOG_FILE="$@" $(abs_top_builddir)/tools/gitlog2changelog.py $(GITLOG_START_POINT) || \ + { printf "gitlog2changelog.py failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; } ; \ + else \ + if ! test -s "$@" ; then \ + printf "Failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; \ + fi ; \ + fi + +ChangeLog.adoc: ChangeLog + +cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../ChangeLog.adoc nut_version.h include/nut_version.h: - cd $(abs_top_builddir)/include && $(MAKE) nut_version.h + +cd $(abs_top_builddir)/include && $(MAKE) $(AM_MAKEFLAGS) nut_version.h tools/gitlog2changelog.py: tools/gitlog2changelog.py.in - cd $(@D) && $(MAKE) -s $(@F) + +cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) -s $(@F) # ---------------------------------------------------------------------- # Maintainers targets: distribution signature and hashes @@ -350,35 +365,35 @@ build: @echo $(WARN) @echo "Warning: 'make build' is deprecated. Use 'make all' instead." @echo $(WARN) - $(MAKE) $(AM_MAKEFLAGS) all + +$(MAKE) $(AM_MAKEFLAGS) all install-bin: @echo $(WARN) @echo "Warning: 'make install-bin' is deprecated." @echo "Use 'make install-exec' instead for a similar effect." @echo $(WARN) - cd common; $(MAKE) $(AM_MAKEFLAGS) install - cd drivers; $(MAKE) $(AM_MAKEFLAGS) install - cd server; $(MAKE) $(AM_MAKEFLAGS) install - cd clients; $(MAKE) $(AM_MAKEFLAGS) install + +cd common; $(MAKE) $(AM_MAKEFLAGS) install + +cd drivers; $(MAKE) $(AM_MAKEFLAGS) install + +cd server; $(MAKE) $(AM_MAKEFLAGS) install + +cd clients; $(MAKE) $(AM_MAKEFLAGS) install install-man: install-data-recursive @echo $(WARN) @echo "Warning: 'make install-man' is deprecated." @echo "Use 'cd man; make install' instead." @echo $(WARN) - cd man; $(MAKE) $(AM_MAKEFLAGS) install + +cd man; $(MAKE) $(AM_MAKEFLAGS) install install-conf: @echo $(WARN) @echo "Warning: 'make install-conf' is deprecated." @echo "Use 'cd conf; make install' instead." @echo $(WARN) - cd conf; $(MAKE) $(AM_MAKEFLAGS) install + +cd conf; $(MAKE) $(AM_MAKEFLAGS) install # The target install-data already has a standardized meaning under automake install-dirs: @echo $(WARN) @echo "Warning: 'make install-dirs' is deprecated." @echo "Use 'make installdirs' instead." @echo $(WARN) - $(MAKE) installdirs + +$(MAKE) installdirs cgi build-cgi install-cgi install-cgi-dir install-cgi-bin \ install-cgi-man install-cgi-conf install-cgi-html: @echo "Error: 'make $@' no longer exists." @@ -413,7 +428,7 @@ MAINTAINERCLEANFILES += $(MAINTAINERCLEANFILES_DISTBALL) MAINTAINERCLEANFILES += $(MAINTAINERCLEANFILES_PACKAGES) package: dist - DESTDIR="$(abs_builddir)/_install_pkgprotodir" ; export DESTDIR; \ + +DESTDIR="$(abs_builddir)/_install_pkgprotodir" ; export DESTDIR; \ rm -rf "$$DESTDIR"; \ case "`uname -s`" in \ "HP-UX") \ @@ -453,8 +468,8 @@ if HAVE_WINDOWS # anything. install-win-bundle: all @if test -z "$(DESTDIR)" ; then echo "ERROR: '$@': Bundle may only be installed to some DESTDIR prototype area'" >&2 ; exit 1; fi - $(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install - $(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install-win-bundle-thirdparty + +$(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install + +$(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install-win-bundle-thirdparty install-win-bundle-thirdparty: @if test -z "$(DESTDIR)" ; then echo "ERROR: '$@': Bundle may only be installed to some DESTDIR prototype area'" >&2 ; exit 1; fi diff --git a/NEWS.adoc b/NEWS.adoc index 064b0d39ca..10319c9cd2 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -133,6 +133,8 @@ https://github.com/networkupstools/nut/milestone/10 * Fixed an issue for builds configured `--without-usb`. [#2263] * Added a fallback for `libgd` discovery (for CGI etc. builds). [#2287] * Made `aspell` TeX module detection more reliable. [#2206] + * Fixed recipes for completely out-of-tree builds to pass with documentation + generation and checking on all tested "make" implementations. [#2318] * Various other recipe and documentation clean-up efforts. [#2284, #2269, #2261] diff --git a/README.adoc b/README.adoc index 1ed2dd4417..2121366665 100644 --- a/README.adoc +++ b/README.adoc @@ -800,7 +800,7 @@ endif::env-github[] See more at link:https://stories.jenkins.io/user-story/jenkins-is-the-way-for-networkupstools/[Jenkins is the way to build multi-platform NUT] article. -| image:images/ci/fosshost.org_Host_Light_38px.png[alt="Fosshost logo",width="112",height="38"] +| image:images/ci/fosshost_org_Host_Light_38px.png[alt="Fosshost logo",width="112",height="38"] | Fosshost provided virtual machines where the multi-platform NUT CI farm with a link:https://github.com/networkupstools/jenkins-dynamatrix/[jenkins-dynamatrix] link:https://github.com/networkupstools/nut/blob/master/Jenkinsfile-dynamatrix[setup] diff --git a/ci_build.sh b/ci_build.sh index 079084402b..83e395e447 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -659,11 +659,18 @@ check_gitignore() { return 0 fi - # One invocation should report to log: - git status $GIT_ARGS -s -- "${FILE_GLOB}" \ - | grep -E -v '^.. \.ci.*\.log.*' \ - | grep -E "${FILE_REGEX}" \ - || echo "WARNING: Could not query git repo while in `pwd`" >&2 + # One invocation should report to log if there was any discrepancy + # to report in the first place (GITOUT may be empty without error): + GITOUT="`git status $GIT_ARGS -s -- "${FILE_GLOB}"`" \ + || { echo "WARNING: Could not query git repo while in `pwd`" >&2 ; GITOUT=""; } + + if [ -n "${GITOUT-}" ] ; then + echo "$GITOUT" \ + | grep -E -v '^.. \.ci.*\.log.*' \ + | grep -E "${FILE_REGEX}" + else + echo "Got no output and no errors querying git repo while in `pwd`: seems clean" >&2 + fi echo "===" # Another invocation checks that there was nothing to complain about: diff --git a/clients/Makefile.am b/clients/Makefile.am index c00bea373f..b873046cc0 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -20,7 +20,7 @@ AM_CXXFLAGS = -DHAVE_NUTCOMMON=1 -I$(top_srcdir)/include $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libcommonclient.la \ $(top_builddir)/common/libparseconf.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) LDADD_FULL = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS) if WITH_SSL diff --git a/common/Makefile.am b/common/Makefile.am index 0f226f1617..a65f2d5dc0 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -42,7 +42,7 @@ common.c: $(top_builddir)/include/nut_version.h $(srcdir)/common.c endif $(top_builddir)/include/nut_version.h: - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) libcommon_la_SOURCES = state.c str.c upsconf.c libcommonclient_la_SOURCES = state.c str.c diff --git a/conf/Makefile.am b/conf/Makefile.am index 8adf280071..873d288324 100644 --- a/conf/Makefile.am +++ b/conf/Makefile.am @@ -19,22 +19,25 @@ nodist_sysconf_DATA = upssched.conf.sample upsmon.conf.sample SPELLCHECK_SRC = $(dist_sysconf_DATA) \ upssched.conf.sample.in upsmon.conf.sample.in -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/data/Makefile.am b/data/Makefile.am index df4cd1a8d1..5fba2e442b 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -6,15 +6,18 @@ dist_data_DATA = cmdvartab nodist_data_DATA = driver.list EXTRA_DIST = evolution500.seq epdu-managed.dev -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ cmdvartab-spellchecked: cmdvartab Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="cmdvartab" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="cmdvartab" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ MAINTAINERCLEANFILES = Makefile.in .dirstamp CLEANFILES = *.pdf *.html *-spellchecked diff --git a/data/html/Makefile.am b/data/html/Makefile.am index 0ef0652637..19436e12da 100644 --- a/data/html/Makefile.am +++ b/data/html/Makefile.am @@ -9,22 +9,25 @@ EXTRA_DIST = README.adoc SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/docs/.gitignore b/docs/.gitignore index c4d2f30a87..6d00f93f51 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -25,3 +25,4 @@ nut.dict.sorted /tmp/ docinfo.xml.in.tmp /asciidoc-vars.conf.lastrev.tmp +.prep-src-docs* diff --git a/docs/Makefile.am b/docs/Makefile.am index 1a9a4732a0..33f0ff5d77 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -3,6 +3,8 @@ MAINTAINERCLEANFILES = Makefile.in .dirstamp EXTRA_DIST = +all: doc + # Is "egrep == grep -E" always valid? (maybe all a job for configure.ac) #EGREP = egrep EGREP = grep -E @@ -27,9 +29,9 @@ IMAGE_LOGO_FILES = \ images/ci/CircleCI_vertical_black_logo.png \ images/ci/DO_Powered_by_Badge_blue.png \ images/ci/DO_Powered_by_Badge_blue_140pxW.png \ - images/ci/fosshost.org_Host_Dark_56px.png \ - images/ci/fosshost.org_Host_Light_309px.png \ - images/ci/fosshost.org_Host_Light_38px.png \ + images/ci/fosshost_org_Host_Dark_56px.png \ + images/ci/fosshost_org_Host_Light_309px.png \ + images/ci/fosshost_org_Host_Light_38px.png \ images/ci/gandi-ar21.png \ images/ci/gandi-ar21.svg \ images/ci/GitHub-Mark-140pxW.png \ @@ -119,9 +121,7 @@ ASCIIDOC_PDF = user-manual.pdf \ FAQ.pdf SUBDIRS = man cables -SUFFIXES = .txt .html .pdf -spellchecked - -all: doc +SUFFIXES = .txt .html .pdf -spellchecked .txt-prepped # This list is defined by configure script choices and options: CHECK_LOCAL_TARGETS = @DOC_CHECK_LIST@ @@ -130,8 +130,11 @@ CHECK_LOCAL_TARGETS += spellcheck endif WITH_SPELLCHECK check-local: $(CHECK_LOCAL_TARGETS) +# Make sure sources are there for out-of-tree builds: +@DOC_BUILD_LIST@ $(ASCIIDOC_PDF) $(ASCIIDOC_HTML_SINGLE) $(ASCIIDOC_HTML_CHUNKED): $(abs_top_builddir)/docs/.prep-src-docs + # This list is defined by configure script choices and options: -doc: @DOC_BUILD_LIST@ +doc: $(abs_top_builddir)/docs/.prep-src-docs @DOC_BUILD_LIST@ # This target can be called by developers to go around the configure # script choices at their risk (e.g. missing tools are possible): @@ -182,19 +185,15 @@ check-html-chunked: $(ASCIIDOC_HTML_CHUNKED) # chosen during configure script execution. The "all-man" and "all-html" # rules build everything documented. check-man all-man man-man all-html html-man: - cd $(top_builddir)/docs/man/ && $(MAKE) -f Makefile $@ + +cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile $@ man: - cd $(top_builddir)/docs/man/ && $(MAKE) -f Makefile all + +cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile all CLEANFILES = *.xml *.html *.pdf *-spellchecked docbook-xsl.css docinfo.xml.in.tmp CLEANFILES += $(top_builddir)/INSTALL.nut $(top_builddir)/UPGRADING $(top_builddir)/NEWS $(top_builddir)/ChangeLog.adoc $(top_builddir)/README CLEANFILES += $(top_builddir)/*.adoc-parsed *.adoc-parsed -# Dirs to clean -clean-local: - $(AM_V_at)rm -rf *.chunked *.bak tmp - ### TODO: general automatic dependency generation # Prepare text files (currently a manually tracked list) @@ -227,8 +226,8 @@ DOCBUILD_CONVERT_GITHUB_LINKS = { \ @$(DOCBUILD_CONVERT_GITHUB_LINKS) $(top_builddir)/ChangeLog: - @echo " DOC-CHANGELOG-GENERATE $@" \ - && cd $(top_builddir) && $(MAKE) $(AM_FLAGS) $(@F) + +@echo " DOC-CHANGELOG-GENERATE $@" \ + && cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # BSD Make dislikes the path resolution here and does not always populate "$<" # (and claims why: "Using $< in a non-suffix rule context is a GNUmake idiom"), @@ -249,6 +248,7 @@ $(top_builddir)/ChangeLog.adoc: $(top_builddir)/ChangeLog && TABCHAR="`printf '\t'`" \ && $(SED) \ -e 's,^\([0-9a-zA-Z]\),=== \1,' \ + -e 's,^=== \(NOTE: \),\1,' \ -e 's,/[+],/\\\\\+,g' \ -e 's,[+][+],\\\+\\\+,g' \ -e 's,^\([ '"$${TABCHAR}"'][^+]*\)\([^+/\]\)[+],\1\2\\\+,g' \ @@ -353,6 +353,12 @@ DOCBUILD_END = { \ fi ; \ } +### Call the prep step consistently to create symlinks (out-of-tree) +### or just touch-files for peace of mind (in-tree builds). Then we +### use these path names (truncated "-prepped") now surely located +### in the builddir as the sources for rendered docs. +*.txt-prepped: $(abs_top_builddir)/docs/.prep-src-docs + # PORTABILITY NOTE: POSIX Make forbids the suffix rule definitions with # prerequisites like done below, and GNU Make of some versions complains; # https://www.gnu.org/software/make/manual/html_node/Error-Messages.html @@ -364,31 +370,43 @@ DOCBUILD_END = { \ # as done below may be pointless in the end (with regard to a portable way # to trigger builds by a changed dependency), but at least predictable and # not toxic. +###.txt.txt-prepped: $(abs_top_builddir)/docs/.prep-src-docs + *.html: common.xsl xhtml.xsl -.txt.html: +.txt-prepped.html: @A2X_OUTDIR="tmp/html-single.$(@F).$$$$" ; \ echo " DOC-HTML Generating $@"; \ $(DOCBUILD_BEGIN) ; RES=0; \ - $(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl $< || RES=$$? ; \ + $(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl "$(&2 ; exit 0; fi; \ - case "$@" in *-spellchecked) ;; *) echo "SKIP: Bogus spellcheck call for non '*-spellchecked' target filename (with make target $@)" >&2 ; exit 0;; esac; \ + if test x"$(SPELLCHECK_SRC_ONE)" = x ; then echo "SKIP: Bogus spellcheck call for empty target filename (with make target $@ from `pwd`)" >&2 ; exit 0; fi; \ + case "$@" in *-spellchecked) ;; *) echo "SKIP: Bogus spellcheck call for non '*-spellchecked' target filename (with make target $@ from `pwd`)" >&2 ; exit 0;; esac; \ rm -f "$@" || true ; \ + $(MKDIR_P) "$(@D)" || exit ; \ REPORT_SRCDIR="$(SPELLCHECK_SRCDIR)"; \ REPORT_SRC_ONE="$(SPELLCHECK_SRC_ONE)"; \ REPORT_PREFIX="" ; \ @@ -510,16 +522,16 @@ spellcheck: echo "ASPELL DEBUG : information about the setup follows:"; \ LANG=$(ASPELL_ENV_LANG); LC_ALL=$(ASPELL_ENV_LANG); export LANG; export LC_ALL; \ $(ASPELL) --help || true; \ - dpkg -l |grep -i aspell || true ; \ + (command -v dpkg) && ( dpkg -l | grep -i aspell ) || true ; \ echo "ASPELL automatic execution line is : ( sed 's,^\(.*\)$$, \1,' < docfile.txt | $(ASPELL) -a $(ASPELL_NUT_TEXMODE_ARGS) $(ASPELL_NUT_COMMON_ARGS) | $(EGREP) -b -v '$(ASPELL_OUT_NOTERRORS)' )" ; \ echo "ASPELL proceeding to spellchecking job..."; \ else true; fi - @FAILED="" ; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \ + +@FAILED="" ; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \ for docsrc in $(SPELLCHECK_SRC); do \ if test "$(SPELLCHECK_ENV_DEBUG)" != no ; then \ echo "ASPELL MAKEFILE DEBUG: Will see from `pwd` if '$(SPELLCHECK_SRCDIR)/$${docsrc}-spellchecked' is up to date" >&2; \ else true ; fi ; \ - $(MAKE) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ + $(MAKE) $(AM_MAKEFLAGS) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ || FAILED="$$FAILED $(SPELLCHECK_SRCDIR)/$$docsrc"; \ done ; \ if test -n "$$FAILED" ; then \ @@ -574,7 +586,7 @@ spellcheck-interactive: echo "FAILED interactive spellcheck for the following sources (relative to `pwd`): $$FAILED" >&2 ; \ exit 1; \ fi ; exit 0 - $(MAKE) spellcheck-sortdict + +$(MAKE) $(AM_MAKEFLAGS) spellcheck-sortdict @echo "------------------------------------------------------------------------"; \ echo "Custom dictionary file $(NUT_SPELL_DICT) may have been updated now."; \ echo "Use 'git add -p docs/$(NUT_SPELL_DICT) && git checkout -- docs/$(NUT_SPELL_DICT) && make spellcheck-sortdict && git add -p docs/$(NUT_SPELL_DICT)'"; \ @@ -592,4 +604,87 @@ spellcheck-interactive: @echo "Documentation spell check not available since 'aspell' was not found." endif !HAVE_ASPELL + +# When building out-of-tree, be sure to have all asciidoc resources +# under the same dir structure (tool limitation) +PREP_SRC = $(EXTRA_DIST) $(SPELLCHECK_SRC_DEFAULT) + +# NOTE: Some "make" implementations prefix a relative or absent path to +# the filenames in PREP_SRC, others (e.g. Sun make) prepend the absolute +# path to locate the sources, so we end up with bogus trees under docs/. +# Code below tries to detect and truncate this mess, including possible +# source texts located in/under parent dirs. +$(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC) + @cd "$(@D)" || exit ; \ + linkroot="$(abs_builddir)" ; \ + if test x"$(abs_srcdir)" = x"$(abs_builddir)" ; then \ + COUNT=0; \ + for F in $(PREP_SRC) ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; \ + if test x"$${linkroot}" = x"$(abs_builddir)" ; then \ + linkroot="$(abs_top_builddir)" ; \ + cd "$(abs_top_builddir)" ; \ + fi ;; \ + esac ; \ + if ! test -e "$${F}-prepped" ; then \ + touch "$${F}-prepped" || exit ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + done ; \ + if ! test -e "$@" ; then touch "$@" ; fi ; \ + else \ + COUNT=30 ; \ + touch "$@.$$$$" ; \ + while test -e "$@.working" -a "$$COUNT" -gt 0 ; do sleep 1; COUNT="`expr $$COUNT - 1`"; done ; \ + touch "$@.working" ; \ + if test -n "`find "$@" -newer "$@.$$$$" 2>/dev/null`" ; then \ + rm -f "$@.$$$$" "$@.working" ; \ + exit 0; \ + fi ; \ + rm -f "$@.$$$$" ; \ + COUNT=0; \ + linksrcroot="$(abs_srcdir)" ; \ + for F in `echo $(PREP_SRC) | tr ' ' '\n' | sort -n | uniq` ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; \ + if test x"$${linkroot}" = x"$(abs_builddir)" ; then \ + linkroot="$(abs_top_builddir)" ; \ + linksrcroot="$(abs_top_srcdir)" ; \ + cd "$(abs_top_builddir)" ; \ + fi ;; \ + "$(srcdir)"/*) F="`echo "$$F" | sed 's#^$(srcdir)/*#./#'`" ;; \ + esac ; \ + D="`dirname "$$F"`" ; \ + $(MKDIR_P) "$${linkroot}/$$D" || { rm -f "$@.working" ; exit 1 ; } ; \ + if ! test -s "$${linkroot}/$$F" && test -s "$${linksrcroot}/$$F" ; then \ + echo " LN '$${linksrcroot}/$$F' => '$${linkroot}/$$F' (PWD = '`pwd`')" >&2 ; \ + ln -fs "$${linksrcroot}/$$F" "$${linkroot}/$$F" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + if ! test -e "$${linkroot}/$${F}-prepped" ; then \ + touch "$${linkroot}/$${F}-prepped" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + done ; \ + fi ; \ + if test "$$COUNT" -gt 0 -o ! -e "$@" ; then touch "$@" ; fi + @rm -f "$@.working" + +# Dirs to clean, etc. +clean-local: + $(AM_V_at)rm -rf *.chunked *.bak tmp + $(AM_V_at)for F in $(PREP_SRC) ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; cd "$(abs_top_builddir)" ;; \ + esac ; \ + if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ + if test -L "$$F" || test -h "$$F" ; then \ + rm -f "$$F" ; \ + fi ; \ + fi ; \ + rm -f "$${F}-prepped" ; \ + done ; \ + rm -f "$(abs_top_builddir)/docs/.prep-src-docs"* + .PHONY: html html-chunked html-single pdf man diff --git a/docs/images/ci/fosshost.org_Host_Dark_56px.png b/docs/images/ci/fosshost_org_Host_Dark_56px.png similarity index 100% rename from docs/images/ci/fosshost.org_Host_Dark_56px.png rename to docs/images/ci/fosshost_org_Host_Dark_56px.png diff --git a/docs/images/ci/fosshost.org_Host_Light_309px.png b/docs/images/ci/fosshost_org_Host_Light_309px.png similarity index 100% rename from docs/images/ci/fosshost.org_Host_Light_309px.png rename to docs/images/ci/fosshost_org_Host_Light_309px.png diff --git a/docs/images/ci/fosshost.org_Host_Light_38px.png b/docs/images/ci/fosshost_org_Host_Light_38px.png similarity index 100% rename from docs/images/ci/fosshost.org_Host_Light_38px.png rename to docs/images/ci/fosshost_org_Host_Light_38px.png diff --git a/docs/images/ci/jenkins-nut.css b/docs/images/ci/jenkins-nut.css index 5861bddd82..634bc00de0 100644 --- a/docs/images/ci/jenkins-nut.css +++ b/docs/images/ci/jenkins-nut.css @@ -66,6 +66,6 @@ background: url("/userContent/layout/DO_Powered_by_Badge_blue_140pxW.png"); /* .page-footer__footer-id-placeholder { -background: url("/userContent/layout/fosshost.org_Host_Dark_56px.png") no-repeat; +background: url("/userContent/layout/fosshost_org_Host_Dark_56px.png") no-repeat; } */ diff --git a/docs/images/ci/jenkins-nut.txt b/docs/images/ci/jenkins-nut.txt index f6fc75dcc1..b7ca13378a 100644 --- a/docs/images/ci/jenkins-nut.txt +++ b/docs/images/ci/jenkins-nut.txt @@ -16,7 +16,7 @@ downscaled image for the Jenkins dashboard banner. There are variants in several resolutions available, and options with a larger or smaller NUT logo served on the Jenkins butler's plate. -The fosshost.org_Host_Dark_56px.png was downscaled from resources +The fosshost_org_Host_Dark_56px.png was downscaled from resources at https://fosshost.org/media/ to fit into the Jenkins dashboard banner and remain readable. Thanks to Fosshost for providing the machines involved in the new NUT CI farm! diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am index de22f78916..2931bc5252 100644 --- a/docs/man/Makefile.am +++ b/docs/man/Makefile.am @@ -20,6 +20,8 @@ #EGREP = egrep EGREP = grep -E +all: + # Base configuration and client manpages, always installed SRC_CONF_PAGES = \ nut.conf.txt \ @@ -837,7 +839,7 @@ LINKMAN_INCLUDE_GENERATED = linkman-driver-names.txt linkman-drivertool-names.tx LINKMAN_INCLUDE_CONSUMERS = index.txt upsd.txt nutupsdrv.txt linkman-driver-names.txt: - @if test x"$(srcdir)" != x"$(builddir)" ; then \ + @if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ if ! test -s "$(builddir)/$@" && test -s "$(srcdir)/$(@F)" ; then \ ln -fs "$(srcdir)/$(@F)" "$(builddir)/" ; \ fi ; \ @@ -852,7 +854,7 @@ linkman-driver-names.txt: @if test ! -s "$@" ; then echo "- No NUT drivers were built" > "$@" ; fi linkman-drivertool-names.txt: - @if test x"$(srcdir)" != x"$(builddir)" ; then \ + @if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ if ! test -s "$(builddir)/$@" && test -s "$(srcdir)/$(@F)" ; then \ ln -fs "$(srcdir)/$(@F)" "$(builddir)/" ; \ fi ; \ @@ -873,7 +875,8 @@ $(LINKMAN_INCLUDE_CONSUMERS): linkman-driver-names.txt linkman-drivertool-names. # git, and not part of tarball (to be in builddir) - so not in EXTRA_DIST. DISTCLEANFILES = $(LINKMAN_INCLUDE_GENERATED) -all: +# Make sure sources are there for out-of-tree builds: +$(HTML_MANS) $(MAN_MANS) index.html: $(abs_top_builddir)/docs/man/.prep-src-docs all-html html-man: $(HTML_MANS) index.html @@ -943,9 +946,9 @@ check-man-txt: $(SRC_ALL_PAGES) echo "FAILED man-source sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \ fi; echo "PASSED man-source sanity check (checked $$CHECKED files)"; exit 0 -CLEANFILES = *-spellchecked +CLEANFILES = *-spellchecked .prep-src-docs *-prepped -SUFFIXES = .txt .html .1 .3 .5 .8 +SUFFIXES = .txt-prepped .txt .html .1 .3 .5 .8 # For builds with allowed installation of prebuild man pages, check that # they exist in sources (make would pull them automatically as a fallback @@ -978,11 +981,6 @@ DOCBUILD_BEGIN = { \ && ! test -w "${builddir}/docbook-xsl.css" \ ; then chmod u+w "${builddir}/docbook-xsl.css" ; fi ; \ chmod -R u+w "./$${A2X_OUTDIR}" || true ; \ - if test x"$(srcdir)" != x"$(builddir)" ; then \ - if ! test -s "$(builddir)/$<" && test -s "$(srcdir)/`basename $<`" ; then \ - ln -fs "$(srcdir)/`basename $<`" "$(builddir)/" ; \ - fi ; \ - fi ; \ A2X_VERBOSE="$(ASCIIDOC_VERBOSE)"; if [ "$(V)" = 1 ]; then A2X_VERBOSE="--verbose"; fi; \ } @@ -1002,6 +1000,14 @@ DOCBUILD_END = { \ fi ; \ } +### Call the prep step consistently to create symlinks (out-of-tree) +### or just touch-files for peace of mind (in-tree builds). Then we +### use these path names (truncated "-prepped") now surely located +### in the builddir as the sources for rendered docs. +*.txt-prepped: $(abs_top_builddir)/docs/man/.prep-src-docs + +#.txt.txt-prepped: $(abs_top_builddir)/docs/man/.prep-src-docs + ### Regarding absolute paths in attributes below: by default asciidoc ### resolves include paths relative to the main document, so while we ### see the relative builddir as "." in the makefile, for included @@ -1009,7 +1015,7 @@ DOCBUILD_END = { \ ### Note: `(top_)srcdir` and `(top_)builddir` must end with a path ### separator, or be empty -- so in all cases letting the resulting ### string resolve meaningfully in the filesystem during docs build. -.txt.html: +.txt-prepped.html: @A2X_OUTDIR="tmp/man-html.$(@F).$$$$" ; \ echo " DOC-MAN-HTML Generating $@"; \ $(DOCBUILD_BEGIN) ; RES=0; \ @@ -1021,7 +1027,7 @@ DOCBUILD_END = { \ --attribute builddir="$(abs_builddir)/" \ --attribute top_srcdir="$(abs_top_srcdir)/" \ --attribute top_builddir="$(abs_top_builddir)/" \ - -o "$${A2X_OUTDIR}/$(@F)" $< || RES=$$? ; \ + -o "$${A2X_OUTDIR}/$(@F)" "$(/dev/null`" ; then \ + rm -f "$@.$$$$" "$@.working" ; \ + exit 0; \ + fi ; \ + rm -f "$@.$$$$" ; \ + COUNT=0; \ + linksrcroot="$(abs_srcdir)" ; \ + for F in `echo $(PREP_SRC) | tr ' ' '\n' | sort -n | uniq` ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; \ + if test x"$${linkroot}" = x"$(abs_builddir)" ; then \ + linkroot="$(abs_top_builddir)" ; \ + linksrcroot="$(abs_top_srcdir)" ; \ + cd "$(abs_top_builddir)" ; \ + fi ;; \ + "$(srcdir)"/*) F="`echo "$$F" | sed 's#^$(srcdir)/*#./#'`" ;; \ + esac ; \ + D="`dirname "$$F"`" ; \ + $(MKDIR_P) "$${linkroot}/$$D" || { rm -f "$@.working" ; exit 1 ; } ; \ + if ! test -e "$${linkroot}/$$F" && test -s "$${linksrcroot}/$$F" ; then \ + echo " LN '$${linksrcroot}/$$F' => '$${linkroot}/$$F' (PWD = '`pwd`')" >&2 ; \ + ln -fs "$${linksrcroot}/$$F" "$${linkroot}/$$F" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + if ! test -e "$${linkroot}/$${F}-prepped" ; then \ + touch "$${linkroot}/$${F}-prepped" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + done ; \ + fi ; \ + if test "$$COUNT" -gt 0 -o ! -e "$@" ; then touch "$@" ; fi + @rm -f "$@.working" MAINTAINERCLEANFILES = Makefile.in .dirstamp clean-local: $(AM_V_at)rm -rf tmp + $(AM_V_at)for F in $(PREP_SRC) ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; cd "$(abs_top_builddir)" ;; \ + esac ; \ + if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ + if test -L "$$F" || test -h "$$F" ; then \ + rm -f "$$F" ; \ + fi ; \ + fi ; \ + rm -f "$${F}-prepped" ; \ + done ; \ + rm -f "$(abs_top_builddir)/docs/man/.prep-src-docs"* diff --git a/docs/nut.dict b/docs/nut.dict index 00c37ba187..96b530f9c3 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3456 utf-8 +personal_ws-1.1 en 3468 utf-8 AAC AAS ABI @@ -550,6 +550,7 @@ IPBX IPC IPM IPP +IPSS IPs IPv IRC @@ -823,8 +824,8 @@ NOTOFF NQA NTP NUT's -NUTClient NUTCONF +NUTClient NUTSRC NUTServer NVA @@ -942,6 +943,7 @@ POSIX POWERDOWNFLAG POWEREX POWERLINE +POWERSTATE PPA PPD PPDn @@ -1145,6 +1147,7 @@ SCO SCR SDA SDE +SDFLAG SDR SDRnnnnn SDT @@ -1164,6 +1167,7 @@ SGI SHA SHUTDOWNCMD SHUTDOWNEXIT +SHUTDOWNSCRIPT SIG SIGHUP SIGINT @@ -1383,6 +1387,7 @@ UNV UPGUARDS UPM UPOII +UPP UPS's UPSCONN UPSDESC @@ -1813,6 +1818,7 @@ clepple clicky cls clueful +clusterware cmake cmd cmdline @@ -2088,6 +2094,7 @@ forcessl formatconfig formatparam formatstring +fosshost fp freebsd freeipmi @@ -2289,6 +2296,7 @@ ipmi ipmidetectd ipmimonitoring ipmipsu +ipp ippon ipv ipxe @@ -2783,6 +2791,7 @@ powerdev powerdown powerdownflag powerfactor +powerfail powerman powermand powermust @@ -2928,6 +2937,7 @@ rts ru rubygem runlevel +runnable runtime runtimecal runtimek @@ -3364,6 +3374,7 @@ virsh virt virtinst virtualization +virtualized vivo vo vod @@ -3384,6 +3395,7 @@ wf wget whitespace wiki +wildcard wildcards wininit winnutclient diff --git a/drivers/Makefile.am b/drivers/Makefile.am index 6d842dcd41..57169b2f91 100644 --- a/drivers/Makefile.am +++ b/drivers/Makefile.am @@ -13,7 +13,7 @@ $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libparseconf.la \ $(top_builddir)/clients/libupsclient.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # by default, link programs in this directory with libcommon.la # (libtool version of the static lib, in order to access LTLIBOBJS) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4ca7fdb52a..f0f59aa877 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -32,22 +32,25 @@ SUBDIRS = augeas devd hotplug installer python systemd udev ufw Solaris Windows SPELLCHECK_SRC = README.adoc RedHat/README.adoc usb_resetter/README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked RedHat/*-spellchecked usb_resetter/*-spellchecked diff --git a/scripts/Solaris/Makefile.am b/scripts/Solaris/Makefile.am index bd7c6ad84e..3f01ec6034 100644 --- a/scripts/Solaris/Makefile.am +++ b/scripts/Solaris/Makefile.am @@ -93,22 +93,25 @@ check-local-solaris-smf: $(SOLARIS_SMF_MANIFESTS) SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/scripts/Windows/Makefile.am b/scripts/Windows/Makefile.am index efc555de1f..52e4d927f8 100644 --- a/scripts/Windows/Makefile.am +++ b/scripts/Windows/Makefile.am @@ -3,7 +3,7 @@ AM_CFLAGS = -I$(top_srcdir)/include ../include/nut_version.h: FORCE - (cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h) + +cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h EXTRA_DIST = \ winevent.mc \ @@ -74,21 +74,24 @@ endif HAVE_MINGW_RESGEN SPELLCHECK_SRC = README.adoc DriverInstaller/README.adoc Installer/README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/devd/Makefile.am b/scripts/devd/Makefile.am index d4801e55e3..e3a9967c2b 100644 --- a/scripts/devd/Makefile.am +++ b/scripts/devd/Makefile.am @@ -33,21 +33,24 @@ EXTRA_DIST += nut-usb.conf.in nut-usb.quirks SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/scripts/hotplug/Makefile.am b/scripts/hotplug/Makefile.am index 7666ab93d5..8888492885 100644 --- a/scripts/hotplug/Makefile.am +++ b/scripts/hotplug/Makefile.am @@ -25,21 +25,24 @@ MAINTAINERCLEANFILES += libhid.usermap SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/scripts/installer/Makefile.am b/scripts/installer/Makefile.am index e661f19564..ae236cf88b 100644 --- a/scripts/installer/Makefile.am +++ b/scripts/installer/Makefile.am @@ -32,22 +32,25 @@ EXTRA_DIST = \ SPELLCHECK_SRC = README.adoc common/README_ipp-os-shutdown.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/scripts/installer/common/README_ipp-os-shutdown.adoc b/scripts/installer/common/README_ipp-os-shutdown.adoc index bf15dbe553..c565cf9d75 100644 --- a/scripts/installer/common/README_ipp-os-shutdown.adoc +++ b/scripts/installer/common/README_ipp-os-shutdown.adoc @@ -83,13 +83,13 @@ It is recommended to configure `SHUTDOWN_TIMER=-1` (default) on those more important hosts which should stay up as long as possible and only shut down if all required UPSes have posted a low-battery status or forced-shutdown command. These hosts would by default schedule delayed -UPS powercycling. To be on the safe side, sufficient `shutdown_duration` +UPS power-cycling. To be on the safe side, sufficient `shutdown_duration` seconds should be configured in their `netxml-ups` driver blocks in the `/usr/local/ups/etc/ups.conf` file on the host. If the customer elects to use the early shutdown strategy for all hosts, the `POWERDOWNFLAG_USER=enforce` should be configured in the hosts with -the highest `SHUTDOWN_TIMER` value so they would cause UPS powercycling. +the highest `SHUTDOWN_TIMER` value so they would cause UPS power-cycling. Do not forget to define sufficient `DELAY` value for the OS shutdown to complete before the UPS turns itself off. The UPS would turn on the load automatically after some time, when external power is back and it has @@ -100,11 +100,11 @@ web-interface for the UPS). * Install the package as usual -- Uncompress the `ipp-*.tar.gz` archive for your OS +- Un-compress the `ipp-*.tar.gz` archive for your OS - Change into the resulting `ipp-*` subdirectory -- (optional) If a complete reinstallation is desired (including removal +- (optional) If a complete re-installation is desired (including removal of old configuration files so they do not conflict with the new delivery), please also execute `IPP_WIPE_OLD_CONFIG=yes; export IPP_WIPE_OLD_CONFIG` in the shell before running the installation script @@ -152,7 +152,7 @@ either `$SDFLAG_HALT` (halt) or `$SDFLAG_REBOOT` (reboot). If the customer elects to use the early shutdown strategy for all hosts, the `POWERDOWNFLAG_USER=enforce` should be configured in the `ipp.conf` file on hosts with the highest `SHUTDOWN_TIMER` value so they would cause -UPS powercycling explicitly. By default, it may be enabled or forbidden +UPS power-cycling explicitly. By default, it may be enabled or forbidden depending on the cause of shutdown. Make sure to define a sufficient `DELAY` value (in seconds) as well, for @@ -184,7 +184,7 @@ ONBATT) is defined manually in the `ipp.conf` file and shutdown routine has started (and reported to be irreversible) - to report that the shutdown is in irreversible stage, as reaction -to CTRL+C during console-run invokations like `ipp-os-shutdown -t now` +to CTRL+C during console-run invocations like `ipp-os-shutdown -t now` - to execute custom shutdown script if it is found, and to skip it if not available @@ -202,7 +202,7 @@ the Eaton NMC Web-GUI - to implement numerous fixes and improvements in the `install.sh` script, including integration of new settings for early shutdown -and UPS powercycling strategy +and UPS power-cycling strategy === A few important notes helpful during testing diff --git a/scripts/python/Makefile.am b/scripts/python/Makefile.am index 7003c62ef7..56eeaa97f4 100644 --- a/scripts/python/Makefile.am +++ b/scripts/python/Makefile.am @@ -196,22 +196,25 @@ SPELLCHECK_SRC = \ app/README.adoc \ module/README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked */*-spellchecked diff --git a/scripts/python/module/Makefile.am b/scripts/python/module/Makefile.am index 17659223eb..fc46eab0ad 100644 --- a/scripts/python/module/Makefile.am +++ b/scripts/python/module/Makefile.am @@ -57,10 +57,10 @@ PyNUTClient: .pypi-src # Tagged releases should only have three blocks of digits separated by dots upload publish: - @echo " PYPI Checking upload type for module version '$(NUT_SOURCE_GITREV_NUMERIC)'" ; \ + +@echo " PYPI Checking upload type for module version '$(NUT_SOURCE_GITREV_NUMERIC)'" ; \ case x"`echo "$(NUT_SOURCE_GITREV_NUMERIC)" | tr -d '[0-9]'`" in \ - x..) echo " PYPI ...release"; $(MAKE) $(AM_FLAGS) upload-pypi ;; \ - x*) echo " PYPI ...testing"; $(MAKE) $(AM_FLAGS) upload-testpypi ;; \ + x..) echo " PYPI ...release"; $(MAKE) $(AM_MAKEFLAGS) upload-pypi ;; \ + x*) echo " PYPI ...testing"; $(MAKE) $(AM_MAKEFLAGS) upload-testpypi ;; \ esac # README.txt is also a part of module standard expectations @@ -119,9 +119,9 @@ upload publish: # Using pypa/setuptools .pypi-dist: .pypi-src - @$(MAKE) $(AM_FLAGS) .pypi-dist-pip-build || \ - $(MAKE) $(AM_FLAGS) .pypi-dist-obsolete || \ - $(MAKE) $(AM_FLAGS) .pypi-dist-pip-wheel + +@$(MAKE) $(AM_MAKEFLAGS) .pypi-dist-pip-build || \ + $(MAKE) $(AM_MAKEFLAGS) .pypi-dist-obsolete || \ + $(MAKE) $(AM_MAKEFLAGS) .pypi-dist-pip-wheel @touch "$@" # The most modern approach as of 2023 diff --git a/scripts/python/module/README.adoc b/scripts/python/module/README.adoc index 8397806dce..18b1d84ddd 100644 --- a/scripts/python/module/README.adoc +++ b/scripts/python/module/README.adoc @@ -126,7 +126,7 @@ ver ~~~ Sends the `VER` command to the NUT data server and returns its self-reported -identification such as version, product or distribution it may be bundied with. +identification such as version, product or distribution it may be bundled with. Note that the NUT client interactions should not rely on reported versions, but follow the protocol as defined. diff --git a/scripts/systemd/Makefile.am b/scripts/systemd/Makefile.am index fa34901c31..7a0f37f7b9 100644 --- a/scripts/systemd/Makefile.am +++ b/scripts/systemd/Makefile.am @@ -41,22 +41,25 @@ endif SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/scripts/udev/Makefile.am b/scripts/udev/Makefile.am index 2c7df88abc..e0576d952c 100644 --- a/scripts/udev/Makefile.am +++ b/scripts/udev/Makefile.am @@ -38,21 +38,24 @@ EXTRA_DIST += nut-usbups.rules.in SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES += *-spellchecked diff --git a/scripts/upsdrvsvcctl/Makefile.am b/scripts/upsdrvsvcctl/Makefile.am index 43bb633b1b..4cb4ad69d2 100644 --- a/scripts/upsdrvsvcctl/Makefile.am +++ b/scripts/upsdrvsvcctl/Makefile.am @@ -14,22 +14,25 @@ EXTRA_DIST += nut-driver-enumerator.sh.in upsdrvsvcctl.in SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/server/Makefile.am b/server/Makefile.am index 24ce399500..878f16f588 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -12,7 +12,7 @@ # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libparseconf.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # Avoid per-target CFLAGS, because this will prevent re-use of object # files. In any case, CFLAGS are only -I options, so there is no harm, diff --git a/tests/Makefile.am b/tests/Makefile.am index 8a4b622588..d7a1cd9ccc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -29,7 +29,7 @@ check_SCRIPTS = # NUT Integration Testing suite check-NIT check-NIT-devel: - cd "$(builddir)/NIT" && $(MAKE) $@ + +cd "$(builddir)/NIT" && $(MAKE) $(AM_MAKEFLAGS) $@ nutlogtest_SOURCES = nutlogtest.c nutlogtest_LDADD = $(top_builddir)/common/libcommon.la @@ -102,7 +102,7 @@ EXTRA_DIST += generic_gpio_utest.h generic_gpio_test.txt $(top_builddir)/drivers/libdummy_mockdrv.la \ $(top_builddir)/common/libnutconf.la \ $(top_builddir)/common/libcommon.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) ### Optional tests which can not be built everywhere # List of src files for CppUnit tests @@ -154,7 +154,7 @@ cppnit_SOURCES = $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC) # only some parts of NUT): $(top_builddir)/clients/libnutclient.la \ $(top_builddir)/clients/libnutclientstub.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) else !HAVE_CPPUNIT # Just redistribute test source into tarball if not building tests diff --git a/tests/NIT/Makefile.am b/tests/NIT/Makefile.am index e0638d26bd..086519757e 100644 --- a/tests/NIT/Makefile.am +++ b/tests/NIT/Makefile.am @@ -25,30 +25,33 @@ check-NIT: $(abs_srcdir)/nit.sh # Make sure pre-requisites for NIT are fresh as we iterate check-NIT-devel: $(abs_srcdir)/nit.sh - @cd .. && ( $(MAKE) -s cppnit$(EXEEXT) || echo "OPTIONAL C++ test client test will be skipped" ) - @cd "$(top_builddir)/clients" && $(MAKE) -s upsc$(EXEEXT) upsrw$(EXEEXT) upsmon$(EXEEXT) - @cd "$(top_builddir)/server" && $(MAKE) -s upsd$(EXEEXT) - @cd "$(top_builddir)/drivers" && $(MAKE) -s dummy-ups$(EXEEXT) - @$(MAKE) check-NIT + +@cd .. && ( $(MAKE) $(AM_MAKEFLAGS) -s cppnit$(EXEEXT) || echo "OPTIONAL C++ test client test will be skipped" ) + +@cd "$(top_builddir)/clients" && $(MAKE) $(AM_MAKEFLAGS) -s upsc$(EXEEXT) upsrw$(EXEEXT) upsmon$(EXEEXT) + +@cd "$(top_builddir)/server" && $(MAKE) $(AM_MAKEFLAGS) -s upsd$(EXEEXT) + +@cd "$(top_builddir)/drivers" && $(MAKE) $(AM_MAKEFLAGS) -s dummy-ups$(EXEEXT) + +@$(MAKE) $(AM_MAKEFLAGS) check-NIT SPELLCHECK_SRC = README.adoc -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ CLEANFILES = *-spellchecked diff --git a/tools/gitlog2changelog.py.in b/tools/gitlog2changelog.py.in index f4c1fd3c1f..a5e4d78660 100755 --- a/tools/gitlog2changelog.py.in +++ b/tools/gitlog2changelog.py.in @@ -54,11 +54,22 @@ except TypeError: fin_mode = 2 fin_chop = 1 -# Create a ChangeLog file in the current directory. -if fin_mode == 3: - fout = open("ChangeLog", "w", encoding="UTF-8") +# Create a ChangeLog file in the current directory by default. +CHANGELOG_FILE = "ChangeLog" +try: + # e.g. point from Makefile to a builddir (caller ensures it exists) + if os.environ.get("CHANGELOG_FILE", None) is not None: + CHANGELOG_FILE = os.environ.get("CHANGELOG_FILE") +except Exception as ignored: + pass + +if CHANGELOG_FILE == "-": + fout = sys.stdout else: - fout = open("ChangeLog", "w") + if fin_mode == 3: + fout = open(CHANGELOG_FILE, "w", encoding="UTF-8") + else: + fout = open(CHANGELOG_FILE, "w") # Set up the loop variables in order to locate the blocks we want authorFound = False diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index 9c7d01fbd6..08ec5919e4 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -24,12 +24,12 @@ EXTRA_DIST = README.adoc # Make sure we have the freshest files (no-op if built earlier and then # no driver sources and other dependencies were edited by a developer) $(NUT_SCANNER_DEPS): dummy - @cd .. && $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps + +@cd .. && $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommonclient.la \ $(top_builddir)/common/libcommon.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # do not hard depend on '../include/nut_version.h', since it blocks # 'dist', and is only required for actual build, in which case @@ -54,7 +54,7 @@ CLEANFILES += $(LINKED_SOURCE_FILES) BUILT_SOURCES += $(LINKED_SOURCE_FILES) $(top_builddir)/include/nut_version.h: - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # Note: we only build nut-scanner, and its library, if libltdl was found (required!) if WITH_NUT_SCANNER diff --git a/tools/nutconf/Makefile.am b/tools/nutconf/Makefile.am index be22d493d8..53663e4a53 100644 --- a/tools/nutconf/Makefile.am +++ b/tools/nutconf/Makefile.am @@ -25,7 +25,7 @@ endif WITH_NUTCONF $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libnutconf.la \ $(top_builddir)/tools/nut-scanner/libnutscan.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) dummy: