Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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
  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:
  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
  40. if [ ! -d $(DESTDIR)$(infodir) ]; then $(MKDIR) $(DESTDIR)$(infodir); else true; fi ;
  41. $(CP) org $(DESTDIR)$(infodir)
  42. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) org
  43. clean:
  44. $(RM) org *.pdf *.html *_letter.tex org-version.inc org-version.tex \
  45. *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \
  46. *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps
  47. cleanall: clean
  48. $(RMR) guide manual
  49. clean-install:
  50. $(RM) $(DESTDIR)$(infodir)/org*
  51. $(INSTALL_INFO) --infodir=$(DESTDIR)$(infodir) --remove org
  52. .SUFFIXES: .texi .tex .txt _letter.tex
  53. %: %.texi org-version.inc
  54. $(MAKEINFO) --no-split $< -o $@
  55. # the following two lines work around a bug in some versions of texi2dvi
  56. %.pdf: LC_ALL=C
  57. %.pdf: LANG=C
  58. %.pdf: %.texi org-version.inc
  59. $(TEXI2PDF) $<
  60. %.pdf: %.tex org-version.tex
  61. PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
  62. %.html: %.texi org-version.inc
  63. $(TEXI2HTML) --no-split -o $@ $<
  64. ifneq ($(SERVERMK),)
  65. ../mk/manfull.pl $@
  66. %.txt: %.tex
  67. perl ../mk/orgcard2txt.pl $< > $@
  68. endif
  69. %_letter.tex: %.tex
  70. $(BATCH) \
  71. --eval '(add-to-list '"'"'load-path "../lisp")' \
  72. --eval '(load "org-compat.el")' \
  73. --eval '(load "../mk/org-fixup.el")' \
  74. --eval '(org-make-letterformat "$(<F)" "$(@F)")'