gbranden pushed a commit to branch master
in repository groff.

commit 5bfd2d2e53587f2a8fe2ddfcc789e9198ff6d92c
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Feb 7 14:27:11 2026 -0600

    Simplify handling of ".version" file.
    
    * Makefile.am (.version): Spell target name without a leading
      `$(top_srcdir)/` interpolation, which caused a build failure using
      Debian's package of BSD make when performing a "make dist" in an
      in-tree build.
    
    * src/devices/xditview/xditview.am ($(GXDITVIEW_GROFF_VERSION_H):
    * src/libs/libgroff/libgroff.am (src/libs/libgroff/version.cpp):
    * src/roff/troff/troff.am (src/roff/troff/majorminor.cpp):
      Update dependencies on ".version" accordingly.
    
    * Makefile.am: Stop appending ".version" to the `EXTRA_DIST` and
      `BUILT_SOURCES` macros--it's unnecessary.  The file is now an ordinary
      build artifact.
    
    Tested with "make check" and "make distcheck" in four configurations:
    the Cartesian product of {BSD, GNU} make with {in-, out-of-}tree builds.
---
 ChangeLog                        | 21 +++++++++++++++++++++
 Makefile.am                      |  4 +---
 src/devices/xditview/xditview.am |  2 +-
 src/libs/libgroff/libgroff.am    |  2 +-
 src/roff/troff/troff.am          |  2 +-
 5 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7f7829c84..4ebaaf44d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2026-02-08  G. Branden Robinson <[email protected]>
+
+       Simplify handling of ".version" file.
+
+       * Makefile.am (.version): Spell target name without a leading
+       `$(top_srcdir)/` interpolation, which caused a build failure
+       using Debian's package of BSD make when performing a "make dist"
+       in an in-tree build.
+       * src/devices/xditview/xditview.am
+       ($(GXDITVIEW_GROFF_VERSION_H):
+       * src/libs/libgroff/libgroff.am (src/libs/libgroff/version.cpp):
+       * src/roff/troff/troff.am (src/roff/troff/majorminor.cpp):
+       Update dependencies on ".version" accordingly.
+       * Makefile.am: Stop appending ".version" to the `EXTRA_DIST` and
+       `BUILT_SOURCES` macros--it's unnecessary.  The file is now an
+       ordinary build artifact.
+
+       Tested with "make check" and "make distcheck" in four
+       configurations: the Cartesian product of {BSD, GNU} make with
+       {in-, out-of-}tree builds.
+
 2026-02-08  G. Branden Robinson <[email protected]>
 
        * doc/doc.am: Simplify generation of HTML documents with groff.
diff --git a/Makefile.am b/Makefile.am
index 1820ee247..e75d5d623 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -868,9 +868,7 @@ SUFFIXES += .man
             >$@
 
 # Version files - see script "build-aux/git-version-gen".
-EXTRA_DIST += $(top_srcdir)/.version
-BUILT_SOURCES += $(top_srcdir)/.version
-$(top_srcdir)/.version:
+.version:
        echo $(VERSION) > $@-t && mv $@-t $@
 dist-hook:
        echo $(VERSION) > $(distdir)/.tarball-version
diff --git a/src/devices/xditview/xditview.am b/src/devices/xditview/xditview.am
index e32e0cbd4..04e959064 100644
--- a/src/devices/xditview/xditview.am
+++ b/src/devices/xditview/xditview.am
@@ -37,7 +37,7 @@ GXDITVIEWSOURCES = \
 
 GXDITVIEW_GROFF_VERSION_H=src/devices/xditview/groff_version.h
 
-$(GXDITVIEW_GROFF_VERSION_H): $(top_srcdir)/.version
+$(GXDITVIEW_GROFF_VERSION_H): .version
        $(AM_V_at)$(MKDIR_P) `dirname $@`
        $(AM_V_GEN)printf \
          'const char *Version_string = "%s";\n' '@VERSION@' > $@
diff --git a/src/libs/libgroff/libgroff.am b/src/libs/libgroff/libgroff.am
index 35212825d..25b705d2a 100644
--- a/src/libs/libgroff/libgroff.am
+++ b/src/libs/libgroff/libgroff.am
@@ -98,7 +98,7 @@ src/libs/libgroff/libgroff_a-fontfile.$(OBJEXT): defs.h
 src/libs/libgroff/libgroff_a-macropath.$(OBJEXT): defs.h
 src/libs/libgroff/libgroff_a-relocate.$(OBJEXT): defs.h
 
-src/libs/libgroff/version.cpp: $(top_srcdir)/.version
+src/libs/libgroff/version.cpp: .version
        $(AM_V_at)printf 'const char *version_string = "%s.%s";\n' \
          $(MAJOR_VERSION) $(MINOR_VERSION) > [email protected]
        $(AM_V_at)printf 'const char *revision_string = "%s";\n' \
diff --git a/src/roff/troff/troff.am b/src/roff/troff/troff.am
index 91415dd71..71da4f0f9 100644
--- a/src/roff/troff/troff.am
+++ b/src/roff/troff/troff.am
@@ -49,7 +49,7 @@ nodist_troff_SOURCES = src/roff/troff/majorminor.cpp
 src/roff/troff/input.$(OBJEXT): defs.h
 CLEANFILES += src/roff/troff/majorminor.cpp
 
-src/roff/troff/majorminor.cpp: $(top_srcdir)/.version
+src/roff/troff/majorminor.cpp: .version
        $(AM_V_at)printf 'const char *major_version = "%s";\n' \
          $(MAJOR_VERSION) > [email protected]
        $(AM_V_at)printf 'const char *minor_version = "%s";\n' \

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to