Makefile 2.8 KB

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