Makefile.am 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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,\
  50. doc-opt-col=0,opt-doc-col=0,header-col=0,rmargin=1' \
  51. $(top_builddir)/src/tar --usage | \
  52. sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
  53. $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
  54. $(info_TEXINFOS) | \
  55. sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
  56. | sort | uniq > docs.$$$$;\
  57. (echo 'Not documented options:';\
  58. join -v1 opts.$$$$ docs.$$$$;\
  59. echo 'Non-existing options:';\
  60. join -v2 opts.$$$$ docs.$$$$) > report.$$$$;\
  61. rm opts.$$$$ docs.$$$$;\
  62. if [ -n "`sed '1,2d' report.$$$$`" ]; then \
  63. cat report.$$$$;\
  64. rm report.$$$$;\
  65. exit 1;\
  66. fi;\
  67. rm report.$$$$
  68. check-refs:
  69. @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
  70. do \
  71. sed -e = $$file | \
  72. sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
  73. done > $@-t; \
  74. if [ -s $@-t ]; then \
  75. echo "Unresolved cross-references:"; \
  76. cat $@-t;\
  77. rm $@-t; \
  78. else \
  79. rm -f $@-t; \
  80. fi
  81. check-fixmes:
  82. @for file in $(info_TEXINFOS); \
  83. do \
  84. sed -e = $$file | \
  85. sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
  86. done > $@-t; \
  87. if [ -s $@-t ]; then \
  88. echo "Unresolved FIXMEs:"; \
  89. cat $@-t; \
  90. rm $@-t; \
  91. false; \
  92. else \
  93. rm -f $@-t; \
  94. fi
  95. check-unrevised:
  96. @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
  97. if [ -s $@-t ]; then \
  98. echo "Unrevised nodes:"; \
  99. cat $@-t; \
  100. rm $@-t; \
  101. false;\
  102. else \
  103. rm $@-t; \
  104. fi
  105. all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
  106. check-docs:
  107. $(MAKE) -k all-check-docs
  108. #
  109. clean-local:
  110. rm -rf manual
  111. GENDOCS=gendocs.sh
  112. TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
  113. # Make sure you set TEXINPUTS
  114. # Usual value is:
  115. # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
  116. manual:
  117. TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
  118. MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
  119. TEXI2DVI="$(TEXI2DVI) -t @finalout" \
  120. $(GENDOCS) --texi2html tar 'GNU tar manual'