groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: doc/doc.am: Refactor and fix sometime build error.


From: G. Branden Robinson
Subject: [groff] 01/01: doc/doc.am: Refactor and fix sometime build error.
Date: Tue, 5 Apr 2022 12:20:41 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit cd1643f22b2cc9ac7f15a6455bcc48f2d5a0b728
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Apr 5 23:04:50 2022 +1000

    doc/doc.am: Refactor and fix sometime build error.
    
    * doc/doc.am: Refactor and fix error in builds in remote
      out-of-source-tree builds exposed by pending commit and `make
      distcheck`.  The images generated for the pic.html and webpage.html
      files were being built in the wrong directory, and subsequently not
      found by an install rule.
    
      (imagedir): Add comment explaining purpose of macro.  It should _not_
      be used with any file specifications relative to the source or build
      trees--it is for installation directories only.
    
      (htmldocimagedir, exampleimagedir): Drop macros.
    
      (doc/pic.html, doc/webpage.html): Replace interpolations of `imagedir`
      with literal "img", since these files are being generated within the
      build tree: the directory name is known.
    
      (mostlyclean_doc, install_doc_htmldoc, install_doc_examples): Replace
      interpolations of `htmldocimagedir` relative to `doc_builddir` with
      "img" literals.
    
      (install_doc_htmldoc, uninstall_doc_htmldoc): Interpolate
      concatenation of `htmldocdir` and `imagedir` instead of
      `htmldocimagedir` (relative to `DESTDIR`).
    
      (install_doc_examples, uninstall_doc_examples): Interpolate
      concatenation of `exampledir` and `imagedir` instead of
      `exampleimagedir` (relative to `DESTDIR`).
---
 ChangeLog  | 27 +++++++++++++++++++++++++++
 doc/doc.am | 51 +++++++++++++++++++++++++--------------------------
 2 files changed, 52 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 413bf012..9531e17d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2022-04-05  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * doc/doc.am: Refactor and fix error in builds in remote
+       out-of-source-tree builds exposed by pending commit and `make
+       distcheck`.  The images generated for the pic.html and
+       webpage.html files were being built in the wrong directory, and
+       subsequently not found by an install rule.
+       (imagedir): Add comment explaining purpose of macro.  It should
+       _not_ be used with any file specifications relative to the
+       source or build trees--it is for installation directories only.
+       (htmldocimagedir, exampleimagedir): Drop macros.
+
+       (doc/pic.html, doc/webpage.html): Replace interpolations of
+       `imagedir` with literal "img", since these files are being
+       generated within the build tree: the directory name is known.
+
+       (mostlyclean_doc, install_doc_htmldoc, install_doc_examples):
+       Replace interpolations of `htmldocimagedir` relative to
+       `doc_builddir` with "img" literals.
+
+       (install_doc_htmldoc, uninstall_doc_htmldoc): Interpolate
+       concatenation of `htmldocdir` and `imagedir` instead of
+       `htmldocimagedir` (relative to `DESTDIR`).
+       (install_doc_examples, uninstall_doc_examples): Interpolate
+       concatenation of `exampledir` and `imagedir` instead of
+       `exampleimagedir` (relative to `DESTDIR`).
+
 2022-04-01  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * doc/doc.am: Refactor.  Relocate "doc/grnexampl.ps" target to
diff --git a/doc/doc.am b/doc/doc.am
index 73c671f6..9189a8bb 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -141,9 +141,10 @@ htmlexamplesdir = $(exampledir)
 nodist_htmlexamples_DATA = $(HTMLEXAMPLEFILES)
 endif
 
+# Locate image subdirectory for HTML documents relative to an
+# installation directory such as `htmldocdir` or `exampledir`.  Do _not_
+# use for locating files within the source or build trees.
 imagedir = img
-htmldocimagedir = $(htmldocdir)/img
-exampleimagedir = $(exampledir)/img
 
 EXTRA_DIST += \
   doc/txi-en.tex
@@ -341,8 +342,8 @@ doc/pic.html: $(doc_srcdir)/pic.ms
        && nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
          $(DOC_SED) -e "1i\\$$nl.lf 1 $(doc_srcdir)/pic.ms$$nl" \
          $(doc_srcdir)/pic.ms \
-          | $(DOC_GROFF_ONLY) -pet -P-Ipic -P-D$(imagedir) -P-jpic \
-                              -Thtml -ms > pic.html
+          | $(DOC_GROFF_ONLY) -pet -P-Ipic -P-Dimg -P-jpic -Thtml -ms \
+          > pic.html
 
 doc/webpage.html: tmac/www.tmac
 doc/webpage.html: $(bin_PROGRAMS) $(prefixexecbin_PROGRAMS)
@@ -359,10 +360,10 @@ doc/webpage.html: \
          $(DOC_SED) -e "1i\\$$nl.lf 1 $(doc_srcdir)/webpage.ms$$nl" \
          $(doc_srcdir)/webpage.ms \
           | $(DOC_GROFF_ONLY) -t -I $(doc_builddir) -I $(doc_srcdir) \
-            -P-jwebpage -P-nrb -P-Iwebpage -P-D$(imagedir) -Thtml -ms \
+            -P-jwebpage -P-nrb -P-Iwebpage -P-Dimg -Thtml -ms \
             > webpage.html
 
-# Note that we remove groff.css only if out-of-source build tree
+# We remove groff.css only from an out-of-source build tree.
 mostlyclean-local: mostlyclean_doc
 mostlyclean_doc:
 if BUILD_HTML
@@ -372,18 +373,17 @@ if BUILD_HTML
            $(RM) $$f; \
          done; \
        fi
-       if test -d $(doc_builddir)/$(imagedir); then \
-         cd $(doc_builddir)/$(imagedir) && \
+       if test -d $(doc_builddir)/img; then \
+         cd $(doc_builddir)/img && \
          for f in $(HTMLDOCIMAGEFILES); do \
            $(RM) $$f; \
          done; \
-         rmdir  $(doc_builddir)/$(imagedir) || :; \
+         rmdir  $(doc_builddir)/img || :; \
        fi
 endif
        if test $(top_builddir) != $(top_srcdir); then \
          $(RM) $(top_builddir)/doc/groff.css; \
        fi
-
 if BUILD_HTMLEXAMPLES
        if test -d $(doc_builddir); then \
          cd $(doc_builddir) && \
@@ -391,12 +391,12 @@ if BUILD_HTMLEXAMPLES
            $(RM) $$f; \
          done; \
        fi
-       if test -d $(doc_builddir)/$(imagedir); then \
-         cd $(doc_builddir)/$(imagedir) && \
+       if test -d $(doc_builddir)/img; then \
+         cd $(doc_builddir)/img && \
          for f in $(HTMLEXAMPLEIMAGEFILES); do \
            $(RM) $$f; \
          done; \
-         rmdir  $(doc_builddir)/$(imagedir) || :; \
+         rmdir  $(doc_builddir)/img || :; \
        fi
 endif
 
@@ -408,12 +408,11 @@ if BUILD_HTML
          $(RM) $(DESTDIR)$(htmldocdir)/$$f; \
          $(INSTALL_DATA) $$f $(DESTDIR)$(htmldocdir)/$$f; \
        done
-       -test -d $(DESTDIR)$(htmldocimagedir) \
-         || $(mkinstalldirs) $(DESTDIR)$(htmldocimagedir)
-       $(RM) $(DESTDIR)$(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
-       $(INSTALL_DATA) \
-         $(doc_builddir)/$(imagedir)/$(HTMLDOCIMAGEFILES) \
-         $(DESTDIR)$(htmldocimagedir)
+       -test -d $(DESTDIR)$(htmldocdir)/$(imagedir) \
+         || $(mkinstalldirs) $(DESTDIR)$(htmldocdir)/$(imagedir)
+       $(RM) $(DESTDIR)$(htmldocdir)/$(imagedir)/$(HTMLDOCIMAGEFILES)
+       $(INSTALL_DATA) $(doc_builddir)/img/$(HTMLDOCIMAGEFILES) \
+         $(DESTDIR)$(htmldocdir)/$(imagedir)
 endif
 
 install-data-hook: install_doc_gnu_eps install_doc_examples
@@ -435,12 +434,12 @@ if BUILD_HTMLEXAMPLES
          $(RM) $(DESTDIR)$(exampledir)/$$f; \
          $(INSTALL_DATA) $$f $(DESTDIR)$(exampledir)/$$f; \
        done
-       -test -d $(DESTDIR)$(exampleimagedir) \
-         || $(mkinstalldirs) $(DESTDIR)$(exampleimagedir)
-       $(RM) $(DESTDIR)$(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
-       $(INSTALL_DATA) \
-         $(doc_builddir)/$(imagedir)/$(HTMLEXAMPLEIMAGEFILES) \
-         $(DESTDIR)$(exampleimagedir)
+       -test -d $(DESTDIR)$(exampledir)/$(imagedir) \
+         || $(mkinstalldirs) $(DESTDIR)$(exampledir)/$(imagedir)
+       $(RM) \
+         $(DESTDIR)$(exampledir)/$(imagedir)/$(HTMLEXAMPLEIMAGEFILES)
+       $(INSTALL_DATA) $(doc_builddir)/img/$(HTMLEXAMPLEIMAGEFILES) \
+         $(DESTDIR)$(exampledir)/$(imagedir)
 endif
 
 uninstall-hook: \
@@ -653,7 +652,7 @@ uninstall_infodoc:
          $(RM) $$f; \
        done
 uninstall-pdf:
-       -$(RM) -f $(DESTDIR)$(pdfdocdir)/groff.pdf 
+       -$(RM) -f $(DESTDIR)$(pdfdocdir)/groff.pdf
 uninstall-html:
        -$(RM) -r $(DESTDIR)$(htmldocdir)/groff.html.*
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]