Makefile.am 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. # Makefile for GNU tar documentation.
  2. # Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2006,
  3. # 2007 Free Software Foundation, Inc.
  4. ## This program 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, or (at your option)
  7. ## any later version.
  8. ## This program 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, write to the Free Software Foundation,
  14. ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  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. getdate.texi\
  23. header.texi\
  24. intern.texi\
  25. rendition.texi\
  26. snapshot.texi\
  27. sparse.texi\
  28. value.texi
  29. EXTRA_DIST = gendocs_template mastermenu.el texify.sed untabify.el
  30. # The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
  31. # Just call `make RENDITION=PROOF [target]' if you want PROOF rendition.
  32. RENDITION = DISTRIB
  33. MAKEINFOFLAGS=-D$(RENDITION)
  34. header.texi: $(top_srcdir)/src/tar.h
  35. sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \
  36. | expand >$@
  37. master-menu: $(tar_TEXINFOS)
  38. emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
  39. untabify:
  40. emacs -batch -l untabify.el $(info_TEXINFOS) $(tar_TEXINFOS)
  41. final: untabify master-menu
  42. # Checking
  43. check-format:
  44. @if test -n "`cat $(info_TEXINFOS) $(tar_TEXINFOS) | tr -d -c '\t'`"; then \
  45. echo "Sources contain tabs; run make untabify"; \
  46. false; \
  47. fi
  48. check-options:
  49. @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' \
  50. $(top_builddir)/src/tar --usage | \
  51. sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
  52. $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
  53. $(info_TEXINFOS) | \
  54. sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
  55. | sort | uniq > docs.$$$$;\
  56. status=0;\
  57. join -v1 opts.$$$$ docs.$$$$ > report.$$$$;\
  58. if test -s report.$$$$; then \
  59. echo 'Not documented options:'; \
  60. cat report.$$$$; \
  61. status=1; \
  62. fi; \
  63. join -v2 opts.$$$$ docs.$$$$ > report.$$$$;\
  64. if test -s report.$$$$; then \
  65. echo 'Non-existing options:';\
  66. cat report.$$$$; \
  67. status=1; \
  68. fi; \
  69. rm opts.$$$$ docs.$$$$ report.$$$$;\
  70. test $$status -ne 0 && exit $$status
  71. check-refs:
  72. @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
  73. do \
  74. sed -e = $$file | \
  75. sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
  76. done > $@-t; \
  77. if [ -s $@-t ]; then \
  78. echo "Unresolved cross-references:"; \
  79. cat $@-t;\
  80. rm $@-t; \
  81. else \
  82. rm -f $@-t; \
  83. fi
  84. check-fixmes:
  85. @for file in $(info_TEXINFOS); \
  86. do \
  87. sed -e = $$file | \
  88. sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
  89. done > $@-t; \
  90. if [ -s $@-t ]; then \
  91. echo "Unresolved FIXMEs:"; \
  92. cat $@-t; \
  93. rm $@-t; \
  94. false; \
  95. else \
  96. rm -f $@-t; \
  97. fi
  98. check-unrevised:
  99. @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
  100. if [ -s $@-t ]; then \
  101. echo "Unrevised nodes:"; \
  102. cat $@-t; \
  103. rm $@-t; \
  104. false;\
  105. else \
  106. rm $@-t; \
  107. fi
  108. all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
  109. check-docs:
  110. $(MAKE) -k all-check-docs
  111. #
  112. clean-local:
  113. rm -rf manual
  114. GENDOCS=gendocs.sh
  115. TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
  116. # Make sure you set TEXINPUTS
  117. # Usual value is:
  118. # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
  119. manual:
  120. TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
  121. MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
  122. TEXI2DVI="$(TEXI2DVI) -t @finalout" \
  123. $(GENDOCS) --texi2html tar 'GNU tar manual'