Merge branch 'ps/build-hotfix'

A topic to optionally build with meson, which has graduated to
'master' recently, has regressed the normal Makefile build, which
is being corrected.

* ps/build-hotfix:
  meson: add options to override build information
  GIT-VERSION-GEN: fix overriding GIT_BUILT_FROM_COMMIT and GIT_DATE
  GIT-VERSION-GEN: fix overriding GIT_VERSION
  Makefile: introduce template for GIT-VERSION-GEN
  Makefile: drop unneeded indirection for GIT-VERSION-GEN outputs
  Makefile: stop including "GIT-VERSION-FILE" in docs
This commit is contained in:
Junio C Hamano
2024-12-23 09:32:26 -08:00
7 changed files with 91 additions and 46 deletions

View File

@@ -181,6 +181,10 @@ endif
-include ../config.mak.autogen
-include ../config.mak
# Set GIT_VERSION_OVERRIDE such that version_gen knows to substitute
# GIT_VERSION in case it was set by the user.
GIT_VERSION_OVERRIDE := $(GIT_VERSION)
ifndef NO_MAN_BOLD_LITERAL
XMLTO_EXTRA += -m manpage-bold-literal.xsl
endif
@@ -211,12 +215,10 @@ XMLTO_EXTRA += --skip-validation
XMLTO_EXTRA += -x manpage.xsl
asciidoctor-extensions.rb: asciidoctor-extensions.rb.in FORCE
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@+
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
$(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
else
asciidoc.conf: asciidoc.conf.in FORCE
$(QUIET_GEN)GIT_USER_AGENT="$(GIT_USER_AGENT)" $(SHELL_PATH) ../GIT-VERSION-GEN "$(shell pwd)/.." $< $@+
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
$(QUIET_GEN)$(call version_gen,"$(shell pwd)/..",$<,$@)
endif
ASCIIDOC_DEPS += docinfo.html
@@ -276,13 +278,6 @@ install-pdf: pdf
install-html: html
'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
../GIT-VERSION-FILE: FORCE
$(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) GIT-VERSION-FILE
ifneq ($(filter-out lint-docs clean,$(MAKECMDGOALS)),)
-include ../GIT-VERSION-FILE
endif
mergetools_txt = mergetools-diff.txt mergetools-merge.txt
#

View File

@@ -219,6 +219,7 @@ asciidoc_conf = custom_target(
input: meson.current_source_dir() / 'asciidoc.conf.in',
output: 'asciidoc.conf',
depends: [git_version_file],
env: version_gen_environment,
)
asciidoc_common_options = [