Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ifeq ($(MAKELEVEL), 0)
  2. $(error This make needs to be started as a sub-make from the toplevel directory.)
  3. endif
  4. GITVERSION = $(shell git describe --abbrev=6 HEAD)
  5. ORGVERSION = $(subst release_,,$(shell git describe --abbrev=0 HEAD))
  6. GITSTATUS = $(shell git status -uno --porcelain)
  7. DATE = $(shell date +%Y-%m-%d)
  8. ifneq ("$(GITSTATUS)", "")
  9. GITVERSION := $(GITVERSION).dirty
  10. endif
  11. .PHONY: all info html pdf card manual guide install clean cleanall clean-install
  12. all: info html pdf card
  13. info: org
  14. html: org.html
  15. pdf: org.pdf orgguide.pdf
  16. card: orgcard.pdf orgcard_letter.pdf orgguide.pdf
  17. manual guide::
  18. $(RMR) $@ ; $(MKDIR) $@
  19. manual:: org.texi
  20. $(TEXI2HTML) -o $@ $<
  21. ../UTILITIES/mansplit.pl $@/*
  22. guide:: orgguide.texi
  23. $(TEXI2HTML) -o $@ $<
  24. ../UTILITIES/guidesplit.pl $@/*
  25. git-describe.texi: org.texi
  26. @echo "@c automatically generated, do not edit" > git-describe.texi
  27. @echo "@set VERSION $(ORGVERSION) ($(GITVERSION))" >> git-describe.texi
  28. @echo "@set DATE $(DATE)" >> git-describe.texi
  29. install: org
  30. if [ ! -d $(infodir) ]; then $(MKDIR) $(infodir); else true; fi ;
  31. $(CP) org $(infodir)
  32. $(INSTALL_INFO) --infodir=$(infodir) org
  33. clean:
  34. $(RM) org *.pdf *.html *_letter.tex \
  35. *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.pg *.pgs \
  36. *.toc *.tp *.tps *.vr *.vrs *.log *.html *.ps git-describe.texi
  37. cleanall: clean
  38. $(RMR) guide manual
  39. clean-install:
  40. $(RM) $(infodir)/org*
  41. $(INSTALL_INFO) --infodir=$(infodir) --remove org
  42. .SUFFIXES: # we don't need default suffix rules
  43. .SUFFIXES: .texi .tex .txt
  44. %: %.texi
  45. $(MAKE) git-describe.texi
  46. $(MAKEINFO) --no-split $< -o $@
  47. %.pdf: LC_ALL=C # work around a bug in texi2dvi
  48. %.pdf: LANG=C # work around a bug in texi2dvi
  49. %.pdf: %.texi
  50. $(TEXI2PDF) $<
  51. %.pdf: %.tex
  52. PDFLATEX=$(PDFTEX) $(TEXI2PDF) $<
  53. %.html: %.texi
  54. $(TEXI2HTML) --no-split -o $@ $<
  55. ../UTILITIES/manfull.pl $@
  56. %.txt: %.tex
  57. perl ../UTILITIES/orgcard2txt.pl $< > $@
  58. %_letter.tex: %.tex
  59. $(SED) -e 's/\\pdflayout=(0l)/\\pdflayout=(1l)/' \
  60. $< > $@