GNUmakefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # $Id$
  2. # Makefile to build Texinfo from the Perl POD documentation,
  3. # using pod2texi.
  4. #
  5. # Copyright 2013, 2014, 2015 Free Software Foundation, Inc.
  6. #
  7. # This file is free software; as a special exception the author gives
  8. # unlimited permission to copy and/or distribute it, with or without
  9. # modifications, as long as this notice is preserved.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  13. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. perl_pod_subdir = $(shell pwd)/perl-[0-9]*.*/pod
  15. texi_pod_doc = perldoc-all
  16. texi_pod_doc_incl = $(texi_pod_doc)-incl.texi
  17. texi_pod_subdir = $(texi_pod_doc)
  18. texinfo_srcdir = $(shell cd ../../ && pwd)
  19. pod2texi = perl $(texinfo_srcdir)/Pod-Simple-Texinfo/pod2texi.pl
  20. pod2texi_args = --base-level=section
  21. pod2texi_args += --preamble='' # we want our own
  22. pod2texi_args += --subdir=$(texi_pod_subdir)
  23. # Unfortunately have to use --no-validate since not all the names and
  24. # L<references> match up. Split HTML by chapter is the natural thing here.
  25. gendocs_args = --email bug-texinfo@gnu.org
  26. gendocs_args += --common "--no-warn --no-validate"
  27. gendocs_args += --split chapter
  28. gendocs_args += --no-ascii
  29. gendocs_args += --source $(texi_pod_subdir)
  30. gendocs_args += --tex "--batch -t @finalout"
  31. gendocs_title = "Perl documentation in Texinfo"
  32. all: $(texi_pod_doc_incl)
  33. rm -rf manual *.aux *.toc *.??
  34. # turns out the combined docs overflow one of TeX's arrays; increase it.
  35. env save_size=100000 \
  36. gendocs.sh $(gendocs_args) $(texi_pod_doc) $(gendocs_title)
  37. $(texi_pod_doc_incl): $(perl_pod_subdir)/*.pod
  38. rm -rf $(texi_pod_subdir)
  39. #
  40. # We remove all X<...> cross-reference constructs from the pods
  41. # before processing, since they are not parsed properly, resulting
  42. # in many chapters called simply "NAME", e.g., perldebug and perlsyn.
  43. #
  44. # We omit the numerous delta pods, which are uninteresting when
  45. # searching (and take tons of time and space to process).
  46. #
  47. # We also omit perlunicook, since it necessarily has many binary Unicode
  48. # characters, and processing the whole thing in UTF-8 makes it less useful.
  49. #
  50. # Because we start from the source directory, we also lose all the
  51. # generated .pods, such as perluniprops. We would not want
  52. # all of them (e.g., perltw.pod), but some (like uniprops) might be nice.
  53. # Maybe someday.
  54. #
  55. cd $(perl_pod_subdir) \
  56. && perl -p -i.bak -e 's,X<.*?>>?,,g' *.pod \
  57. && $(pod2texi) -o $@ $(pod2texi_args) \
  58. `ls *.pod | egrep -v "(delta|unicook)"` \
  59. && mv $(texi_pod_subdir) $@ ../..
  60. # updating on www.gnu.org. We do not install the split HTML files
  61. # because the long file names cause trouble for some GNU webmasters,
  62. # who use encryption software that reduces the maximum file name length
  63. # by about half. Sigh.
  64. www_target = $(HOME)/gnu/www/www/software/perl/manual
  65. install:
  66. cp -arf manual/. $(www_target)/.
  67. rm -rf $(www_target)/html_chapter
  68. cd $(www_target) && cvs update -P
  69. mostlyclean:
  70. rm -rf manual $(texi_pod_doc_incl)
  71. # when running make dist, ensure we have none of the build files,
  72. # since the whole contrib/ directory is included in its entirety.
  73. distclean:
  74. rm -rf manual perl-5.*.* $(texi_pod_doc) $(texi_pod_doc_incl)
  75. rm -rf *.?? *.??? *.info *~ \#*