Makefile.am 4.0 KB

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