Makefile 2.4 KB

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