texibuild.am 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ## automake - create Makefile.in from Makefile.am
  2. ## Copyright (C) 1994-2017 Free Software Foundation, Inc.
  3. ## This program is free software; you can redistribute it and/or modify
  4. ## it under the terms of the GNU General Public License as published by
  5. ## the Free Software Foundation; either version 2, or (at your option)
  6. ## any later version.
  7. ## This program is distributed in the hope that it will be useful,
  8. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ## GNU General Public License for more details.
  11. ## You should have received a copy of the GNU General Public License
  12. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
  14. ?!GENERIC_INFO?%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
  15. ## It is wrong to have 'info' files dependent on %DIRSTAMP%, because
  16. ## 'info' files are distributed and %DIRSTAMP% isn't: a distributed file
  17. ## should never be dependent upon a non-distributed built file.
  18. ## Therefore we ensure that %DIRSTAMP% exists in the rule.
  19. ?!INSRC??DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
  20. ## Back up the info files before running makeinfo. This is the cheapest
  21. ## way to ensure that
  22. ## 1) If the texinfo file shrinks (or if you start using --no-split),
  23. ## you'll not be left with some dead info files lying around -- dead
  24. ## files which would end up in the distribution.
  25. ## 2) If the texinfo file has some minor mistakes which cause makeinfo
  26. ## to fail, the info files are not removed. (They are needed by the
  27. ## developer while he writes documentation.)
  28. ## *.iNN files are used on DJGPP. See the comments in install-info-am
  29. %AM_V_MAKEINFO%restore=: && backupdir="$(am__leading_dot)am$$$$" && \
  30. ?INSRC? am__cwd=`pwd` && $(am__cd) $(srcdir) && \
  31. rm -rf $$backupdir && mkdir $$backupdir && \
  32. ## If makeinfo is not installed we must not backup the files so
  33. ## 'missing' can do its job and touch $@ if it exists.
  34. if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
  35. for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
  36. if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
  37. done; \
  38. else :; fi && \
  39. ?INSRC? cd "$$am__cwd"; \
  40. if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
  41. ?!INSRC? -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
  42. ?INSRC??!GENERIC_INFO? -o $@ $(srcdir)/%SOURCE_INFO%; \
  43. ?INSRC??GENERIC_INFO? -o $@ $<; \
  44. then \
  45. rc=0; \
  46. ?INSRC? $(am__cd) $(srcdir); \
  47. else \
  48. rc=$$?; \
  49. ## Beware that backup info files might come from a subdirectory.
  50. ?INSRC? $(am__cd) $(srcdir) && \
  51. $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
  52. fi; \
  53. rm -rf $$backupdir; exit $$rc
  54. INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
  55. ?GENERIC?%SOURCE_SUFFIX%.dvi:
  56. ?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
  57. %AM_V_TEXI2DVI%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
  58. ## Must set MAKEINFO like this so that version.texi will be found even
  59. ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
  60. MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
  61. ## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
  62. ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
  63. ## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
  64. ## by-products are left in there, instead of cluttering the current
  65. ## directory (see automake bug#11146). Use a different build-dir for
  66. ## each file (and distinct from that of the corresponding PDF file) to
  67. ## avoid hitting a Texinfop bug that could cause low-probability racy
  68. ## failure when doing parallel builds; see:
  69. ## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
  70. $(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
  71. ?GENERIC? %SOURCE%
  72. ?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
  73. ?GENERIC?%SOURCE_SUFFIX%.pdf:
  74. ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
  75. %AM_V_TEXI2PDF%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
  76. ## Must set MAKEINFO like this so that version.texi will be found even
  77. ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
  78. MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
  79. ## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
  80. ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
  81. ## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
  82. ## by-products are left in there, instead of cluttering the current
  83. ## directory (see automake bug#11146). Use a different build-dir for
  84. ## each file (and distinct from that of the corresponding DVI file) to
  85. ## avoid hitting a Texinfop bug that could cause low-probability racy
  86. ## failure when doing parallel builds; see:
  87. ## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
  88. $(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
  89. ?GENERIC? %SOURCE%
  90. ?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
  91. ?GENERIC?%SOURCE_SUFFIX%.html:
  92. ?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
  93. ## When --split (the default) is used, makeinfo will output a
  94. ## directory. However it will not update the time stamp of a
  95. ## previously existing directory, and when the names of the nodes
  96. ## in the manual change, it may leave unused pages. Our fix
  97. ## is to build under a temporary name, and replace the target on
  98. ## success.
  99. %AM_V_MAKEINFO%rm -rf $(@:.html=.htp)
  100. %SILENT%if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
  101. ?GENERIC? -o $(@:.html=.htp) %SOURCE%; \
  102. ?!GENERIC? -o $(@:.html=.htp) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%; \
  103. then \
  104. rm -rf $@ && mv $(@:.html=.htp) $@; \
  105. else \
  106. rm -rf $(@:.html=.htp); exit 1; \
  107. fi
  108. ## If we are using the generic rules, we need separate dependencies.
  109. ## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
  110. ## rules.)
  111. if %?GENERIC_INFO%
  112. %DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
  113. endif %?GENERIC_INFO%
  114. if %?GENERIC%
  115. %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
  116. %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
  117. %DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
  118. endif %?GENERIC%