Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. org.texi: org-manual.org
  24. $(BATCH) \
  25. --eval '(add-to-list `load-path "../lisp")' \
  26. --eval '(load "../mk/org-fixup.el")' \
  27. --eval '(org-make-manual)'
  28. orgguide.texi: org-guide.org
  29. $(BATCH) \
  30. --eval '(add-to-list `load-path "../lisp")' \
  31. --eval '(load "../mk/org-fixup.el")' \
  32. --eval '(org-make-guide)'
  33. org-version.inc: org.texi
  34. @echo "org-version: $(ORGVERSION) ($(GITVERSION))"
  35. @echo "@c automatically generated, do not edit" > org-version.inc
  36. @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> org-version.inc
  37. @echo "@set DATE $(DATE)" >> org-version.inc
  38. org-version.tex: orgcard.tex
  39. @printf "org-version: $(ORGVERSION) ($(GITVERSION))\n"
  40. @printf "%% automatically generated, do not edit\n" > org-version.tex
  41. @printf "\def\orgversionnumber{$(ORGVERSION)}\n" >> org-version.tex
  42. @printf "\def\\\\versionyear{$(YEAR)}\n" >> org-version.tex
  43. @printf "\def\year{$(YEAR)}\n" >> org-version.tex
  44. install: org orgguide
  45. if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
  46. $(CP) org.info $(DESTDIR)$(infodir)
  47. $(CP) orgguide.info $(DESTDIR)$(infodir)
  48. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org.info
  49. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) orgguide.info
  50. clean:
  51. $(RM) *.pdf *.html *.info *_letter.tex org-version.inc org-version.tex \
  52. *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs *.toc \
  53. *.tp *.tps *.vr *.vrs *.log *.ps
  54. cleanall: clean
  55. $(RM) org.texi orgguide.texi
  56. $(RMR) guide manual
  57. clean-install:
  58. $(RM) $(DESTDIR)$(infodir)/org*
  59. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org
  60. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove orgguide
  61. .SUFFIXES: .texi .tex .txt _letter.tex
  62. %: %.texi org-version.inc
  63. $(MAKEINFO) --no-split $< -o $@.info
  64. # the following two lines work around a bug in some versions of texi2dvi
  65. %.pdf: LC_ALL=C
  66. %.pdf: LANG=C
  67. %.pdf: %.texi org-version.inc
  68. $(TEXI2PDF) $<
  69. %.pdf: %.tex org-version.tex
  70. PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
  71. %.html: %.texi org-version.inc
  72. $(TEXI2HTML) --no-split -o $@ $<
  73. ifneq ($(SERVERMK),)
  74. ../mk/manfull.pl $@
  75. %.txt: %.tex
  76. perl ../mk/orgcard2txt.pl $< > $@
  77. endif
  78. %_letter.tex: %.tex
  79. $(BATCH) \
  80. --eval '(add-to-list `load-path "../lisp")' \
  81. --eval '(load "org-compat.el")' \
  82. --eval '(load "../mk/org-fixup.el")' \
  83. --eval '(org-make-letterformat "$(<F)" "$(@F)")'