server.mk 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #----------------------------------------------------------------------
  2. # This file is used for maintenance of org on the server.
  3. #----------------------------------------------------------------------
  4. .PHONY: helpserver \
  5. release rel-dirty rel-up cleanrel \
  6. elpa elpa-dirty elpa-up \
  7. doc-up \
  8. upload-release upload-elpa upload-doc upload \
  9. tagwarn version
  10. help helpall helpserver::
  11. $(info )
  12. $(info Maintenance)
  13. $(info ===========)
  14. $(info release - clean up and create distribution archives)
  15. $(info elpa - clean up and create ELPA archive)
  16. $(info upload - clean up and populate server directories)
  17. helpserver::
  18. @echo ""
  19. #----------------------------------------------------------------------
  20. ORGCOMM = README request-assign-future.txt lisp/ doc/
  21. ORGFULL = $(ORGCOMM) Makefile \
  22. mk/default.mk mk/targets.mk mk/version.mk \
  23. mk/org-fixup.el \
  24. etc/ contrib/
  25. ORGFULL := $(ORGFULL:%/=%/*)
  26. ORGELPA = $(ORGCOMM) etc/styles/ org-pkg.el
  27. ORGELPA := $(ORGELPA:%/=%/*)
  28. release: ORG_MAKE_DOC=info pdf card # do not make HTML documentation
  29. release: cleanall doc rel-dirty tagwarn
  30. rel-dirty rel-up: ORGDIR=org-$(GITVERSION:release_%=%)
  31. rel-dirty:
  32. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-dist version autoloads
  33. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGRZIP)
  34. ln -s . $(ORGDIR)
  35. tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  36. zip -r9 $(ORGDIR).zip $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  37. -@$(RM) $(ORGDIR)
  38. rel-up: rel-dirty
  39. $(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
  40. PKG_TAG = $(shell date +%Y%m%d)
  41. PKG_DOC = "Outline-based notes management and organizer"
  42. PKG_REQ = "nil"
  43. elpa: ORG_MAKE_DOC=info pdf card # do not make HTML documentation
  44. elpa: cleanall doc elpa-dirty
  45. elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
  46. elpa-dirty:
  47. @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
  48. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  49. ln -s . $(ORGDIR)
  50. echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" >org-pkg.el
  51. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  52. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  53. -@$(RM) $(ORGDIR) org-pkg.el
  54. elpa-up: elpa-dirty
  55. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  56. tagwarn:
  57. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  58. $(info ======================================================) \
  59. $(info = =) \
  60. $(info = A release should only be made from a revision that =) \
  61. $(info = has an annotated tag! =) \
  62. $(info = =) \
  63. $(info ======================================================))
  64. version:
  65. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  66. @echo "ORGVERSION ?= $(ORGVERSION)" > mk/version.mk
  67. @echo "GITVERSION ?= $(GITVERSION)" >> mk/version.mk
  68. cleanall clean: cleanrel
  69. cleanrel:
  70. -$(RM) org-$(PKG_TAG)* org-$(DISTVERSION)* org-*.zip org-*.tar* mk/version.mk
  71. doc-up:
  72. $(MAKE) -C doc html manual guide
  73. $(CP) doc/org.html $(SERVROOT)
  74. $(CP) doc/manual/* $(SERVROOT)/manual
  75. $(CP) doc/guide/* $(SERVROOT)/guide
  76. upload upload-elpa upload-release upload-doc: ORG_MAKE_DOC=info pdf card
  77. upload: cleanall doc elpa-up rel-up doc-up
  78. upload-elpa: cleanall doc elpa-up
  79. upload-release: cleanall doc rel-up
  80. upload-doc: cleanall doc doc-up