Makefile.am 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # Makefile for GNU tar documentation.
  2. # Copyright 1994-2023 Free Software Foundation, Inc.
  3. # This file is part of GNU tar.
  4. # GNU tar is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3 of the License, or
  7. # (at your option) any later version.
  8. # GNU tar is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. info_TEXINFOS = tar.texi
  15. tar_TEXINFOS = \
  16. dumpdir.texi\
  17. tar-snapshot-edit.texi\
  18. fdl.texi\
  19. genfile.texi\
  20. header.texi\
  21. intern.texi\
  22. parse-datetime.texi\
  23. recipes.texi\
  24. rendition.texi\
  25. snapshot.texi\
  26. sparse.texi\
  27. value.texi
  28. dist_man_MANS=tar.1 $(RMT_8)
  29. if PU_RMT_COND
  30. RMT_8=rmt.8
  31. endif
  32. EXTRA_DIST = gendocs_template mastermenu.el texify.sed untabify.el rmt.8
  33. # The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
  34. # Just call 'make RENDITION=PROOF [target]' if you want PROOF rendition.
  35. RENDITION = DISTRIB
  36. MAKEINFOFLAGS=-D$(RENDITION)
  37. header.texi: $(top_srcdir)/src/tar.h
  38. sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \
  39. | expand >$@
  40. master-menu: $(tar_TEXINFOS)
  41. emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
  42. untabify:
  43. emacs -batch -l untabify.el $(info_TEXINFOS) $(tar_TEXINFOS)
  44. final: untabify master-menu
  45. # Checking
  46. check-format:
  47. @if test -n "`cat $(info_TEXINFOS) $(tar_TEXINFOS) | tr -d -c '\t'`"; then \
  48. echo "Sources contain tabs; run make untabify"; \
  49. false; \
  50. fi
  51. check-options:
  52. @ARGP_HELP_FMT='usage-indent=0,short-opt-col=0,long-opt-col=0,doc-opt-col=0,opt-doc-col=0,header-col=0,rmargin=1' \
  53. $(top_builddir)/src/tar --usage | \
  54. sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
  55. $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
  56. $(info_TEXINFOS) | \
  57. sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
  58. | sort | uniq > docs.$$$$;\
  59. status=0;\
  60. join -v1 opts.$$$$ docs.$$$$ > report.$$$$;\
  61. if test -s report.$$$$; then \
  62. echo 'Not documented options:'; \
  63. cat report.$$$$; \
  64. status=1; \
  65. fi; \
  66. join -v2 opts.$$$$ docs.$$$$ > report.$$$$;\
  67. if test -s report.$$$$; then \
  68. echo 'Non-existing options:';\
  69. cat report.$$$$; \
  70. status=1; \
  71. fi; \
  72. rm opts.$$$$ docs.$$$$ report.$$$$;\
  73. test $$status -ne 0 && exit $$status
  74. check-refs:
  75. @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
  76. do \
  77. sed -e = $$file | \
  78. sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
  79. done > $@-t; \
  80. if [ -s $@-t ]; then \
  81. echo "Unresolved cross-references:"; \
  82. cat $@-t;\
  83. rm $@-t; \
  84. else \
  85. rm -f $@-t; \
  86. fi
  87. check-fixmes:
  88. @for file in $(info_TEXINFOS); \
  89. do \
  90. sed -e = $$file | \
  91. sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
  92. done > $@-t; \
  93. if [ -s $@-t ]; then \
  94. echo "Unresolved FIXMEs:"; \
  95. cat $@-t; \
  96. rm $@-t; \
  97. false; \
  98. else \
  99. rm -f $@-t; \
  100. fi
  101. check-unrevised:
  102. @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
  103. if [ -s $@-t ]; then \
  104. echo "Unrevised nodes:"; \
  105. cat $@-t; \
  106. rm $@-t; \
  107. false;\
  108. else \
  109. rm $@-t; \
  110. fi
  111. all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
  112. check-docs:
  113. $(MAKE) -k all-check-docs
  114. #
  115. clean-local:
  116. rm -rf manual
  117. GENDOCS=$(srcdir)/gendocs.sh
  118. TEXI2DVI=texi2dvi -E
  119. # Make sure you set TEXINPUTS
  120. # Usual value is:
  121. # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
  122. manual:
  123. TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
  124. MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
  125. TEXI2DVI="$(TEXI2DVI) -t '@set DISTRIB' -t @finalout" \
  126. $(GENDOCS) --texi2html tar 'GNU tar manual'
  127. manual-rebuild: clean-local manual