Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .SUFFIXES: # we don't need default suffix rules
  2. ifeq ($(MAKELEVEL), 0)
  3. $(error This make needs to be started as a sub-make from the toplevel directory.)
  4. endif
  5. .PHONY: all info html pdf card manual guide install \
  6. clean cleanall clean-install
  7. all: $(ORG_MAKE_DOC)
  8. info: org orgguide
  9. html: org.html orgguide.html
  10. pdf: org.pdf orgguide.pdf
  11. card: orgcard.pdf orgcard_letter.pdf orgguide.pdf
  12. ifneq ($(SERVERMK),)
  13. manual guide::
  14. -$(RMR) $@
  15. $(MKDIR) $@
  16. manual:: org.texi org-version.inc
  17. $(TEXI2HTML) -o $@ $<
  18. ../mk/mansplit.pl $@/*
  19. guide:: orgguide.texi org-version.inc
  20. $(TEXI2HTML) -o $@ $<
  21. ../mk/guidesplit.pl $@/*
  22. endif
  23. # We increase GC threshold when generating documentation. This
  24. # imrpoves the performance significantly. See
  25. # https://yhetil.org/emacs-devel/9778F176-E724-4E61-B0FB-327BCDD316C0@acm.org
  26. # Too high number may cause memory overflow (for example, it has
  27. # happened in CI during automated build). We choose 50Mb threshold,
  28. # based on the above discussion.
  29. org.texi: org-manual.org
  30. $(BATCH) \
  31. --eval '(add-to-list `load-path "../lisp")' \
  32. --eval '(load "../mk/org-fixup.el")' \
  33. --eval '(setq gc-cons-threshold (* 50 1000 1000))' \
  34. --eval '(org-make-manual)'
  35. orgguide.texi: org-guide.org
  36. $(BATCH) \
  37. --eval '(add-to-list `load-path "../lisp")' \
  38. --eval '(load "../mk/org-fixup.el")' \
  39. --eval '(setq gc-cons-threshold (* 50 1000 1000))' \
  40. --eval '(org-make-guide)'
  41. org-version.inc: org.texi
  42. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  43. @echo "@c automatically generated, do not edit" > org-version.inc
  44. @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc
  45. @echo "@set DATE $(DATE)" >> org-version.inc
  46. org-version.tex: orgcard.tex
  47. @printf "org-version: $(ORGVERSION) ($(GITVERSION))\n"
  48. @printf "%% automatically generated, do not edit\n" > org-version.tex
  49. @printf "\def\orgversionnumber{$(ORGVERSION)}\n" >> org-version.tex
  50. @printf "\def\\\\versionyear{$(YEAR)}\n" >> org-version.tex
  51. @printf "\def\year{$(YEAR)}\n" >> org-version.tex
  52. install: org orgguide
  53. if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
  54. $(CP) org.info $(DESTDIR)$(infodir)
  55. $(CP) orgguide.info $(DESTDIR)$(infodir)
  56. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org.info
  57. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) orgguide.info
  58. clean:
  59. $(RM) *.pdf *.html *.info *_letter.tex org-version.inc org-version.tex \
  60. *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs *.toc \
  61. *.tp *.tps *.vr *.vrs *.log *.ps
  62. cleanall: clean
  63. $(RM) org.texi orgguide.texi
  64. $(RMR) guide manual
  65. clean-install:
  66. $(RM) $(DESTDIR)$(infodir)/org*
  67. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org
  68. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove orgguide
  69. .SUFFIXES: .texi .tex .txt _letter.tex
  70. %: %.texi org-version.inc
  71. $(MAKEINFO) --no-split $< -o $@.info
  72. # the following two lines work around a bug in some versions of texi2dvi
  73. %.pdf: LC_ALL=C
  74. %.pdf: LANG=C
  75. %.pdf: %.texi org-version.inc
  76. $(TEXI2PDF) $<
  77. %.pdf: %.tex org-version.tex
  78. PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
  79. %.html: %.texi org-version.inc
  80. $(TEXI2HTML) --no-split -o $@ $<
  81. ifneq ($(SERVERMK),)
  82. ../mk/manfull.pl $@
  83. %.txt: %.tex
  84. perl ../mk/orgcard2txt.pl $< > $@
  85. endif
  86. %_letter.tex: %.tex
  87. $(BATCH) \
  88. --eval '(add-to-list `load-path "../lisp")' \
  89. --eval '(load "org-compat.el")' \
  90. --eval '(load "../mk/org-fixup.el")' \
  91. --eval '(org-make-letterformat "$(<F)" "$(@F)")'