server.mk 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.mk
  10. help helpall helpserver::
  11. $(info )
  12. $(info Maintenance)
  13. $(info ===========)
  14. $(info release - clean up and create TAR/ZIP release archives)
  15. $(info elpa - clean up and create ELPA TAR 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 default.mk targets.mk version.mk \
  22. etc/ contrib/ utils/
  23. ORGFULL := $(ORGFULL:%/=%/*)
  24. ORGELPA = $(ORGCOMM) etc/styles/ org-pkg.el
  25. ORGELPA := $(ORGELPA:%/=%/*)
  26. release: ORG_MAKE_DOC=info pdf card # do not make HTML documentation
  27. release: cleanall doc rel-dirty
  28. rel-dirty rel-up: ORGDIR=org-$(GITVERSION:release_%=%)
  29. rel-dirty rel-up: ORGDIST=-dist
  30. rel-dirty: autoloads version.mk
  31. -@$(RM) $(ORGDIR) $(ORGRTAR) $(ORGRZIP)
  32. ln -s . $(ORGDIR)
  33. tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  34. zip -r9 $(ORGDIR).zip $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
  35. -@$(RM) $(ORGDIR)
  36. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  37. @$(MAKE) tagwarn)
  38. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  39. rel-up: rel-dirty
  40. $(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
  41. PKG_TAG = $(shell date +%Y%m%d)
  42. PKG_DOC = "Outline-based notes management and organizer"
  43. PKG_REQ = "nil"
  44. elpa: ORG_MAKE_DOC=info pdf card # do not make HTML documentation
  45. elpa: cleanall doc elpa-dirty
  46. elpa-dirty elpa-up: ORGDIR=org-$(PKG_TAG)
  47. elpa-dirty elpa-up: ORGDIST=-elpa
  48. elpa-dirty: autoloads version.mk
  49. -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
  50. ln -s . $(ORGDIR)
  51. echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" >org-pkg.el
  52. tar --exclude=Makefile --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
  53. $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
  54. -@$(RM) $(ORGDIR) org-pkg.el
  55. $(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
  56. @$(MAKE) tagwarn)
  57. @echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
  58. elpa-up: elpa-dirty
  59. $(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
  60. tagwarn:
  61. $(info ======================================================)
  62. $(info = =)
  63. $(info = A release should only be made from a revision that =)
  64. $(info = has an annotated tag! =)
  65. $(info = =)
  66. $(info ======================================================)
  67. @echo ""
  68. version.mk:
  69. @echo "ORGVERSION ?= $(ORGVERSION)" > $@
  70. @echo "GITVERSION ?= $(GITVERSION)$(ORGDIST)" >> $@
  71. cleanall clean: cleanrel
  72. cleanrel:
  73. -$(RM) org-*.zip org-*.tar* version.mk
  74. doc-up:
  75. $(MAKE) -C doc html manual guide
  76. $(CP) doc/org.html $(SERVROOT)
  77. $(CP) doc/manual/* $(SERVROOT)/manual
  78. $(CP) doc/guide/* $(SERVROOT)/guide
  79. upload upload-elpa upload-release upload-doc: ORG_MAKE_DOC=info pdf card
  80. upload: cleanall doc elpa-up rel-up doc-up
  81. upload-elpa: cleanall doc elpa-up
  82. upload-release: cleanall doc rel-up
  83. upload-doc: cleanall doc doc-up