Browse Source

server.mk: add version.mk to distribution archives

* targets.mk: If $(ORGVERSION) and $(GITVERSION) are not defined and
  cannot be determined from Git, try to read `version.mk´.  Fall back
  to "N/A" if still no definition has been made.

* utils/server.mk: Create `version.mk´ for each distribution.  Append
  "-dist" and "-elpa" to $(GITVERSION) to easily recognize builds from
  distribution archives.  Remove `version.mk´ in `cleanrel´ and use
  the same globbing patterns as .gitignore.

* .gitignore: Add "version.mk", also ignore ELPA archive (no ".gz"
  suffix) and only "org-version.el" (no globbing).
Achim Gratz 7 years ago
parent
commit
ee9e27e66e
3 changed files with 20 additions and 11 deletions
  1. 3 2
      .gitignore
  2. 1 0
      targets.mk
  3. 16 9
      utils/server.mk

+ 3 - 2
.gitignore

@@ -31,9 +31,10 @@ orgcard_letter.tex
 orgcard.txt
 org
 org-install.el
-org-version.*
-org-*.tar.gz
+org-version.el
+org-*.tar*
 org-*.zip
+version.mk
 manual
 org_dual_license.texi
 ORGWEBPAGE/Changes.txt

+ 1 - 0
targets.mk

@@ -22,6 +22,7 @@ ifneq ($(wildcard .git),)
   ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
   GITSTATUS  ?= $(shell git status -uno --porcelain)
 else
+ -include version.mk
   GITVERSION ?= N/A
   ORGVERSION ?= N/A
 endif

+ 16 - 9
utils/server.mk

@@ -6,7 +6,7 @@
 	elpa elpa-dirty elpa-up \
 	doc-up \
 	upload-release upload-elpa upload-doc upload \
-	tagwarn
+	tagwarn version.mk
 
 help helpall helpserver::
 	$(info )
@@ -21,15 +21,17 @@ helpserver::
 #----------------------------------------------------------------------
 
 ORGCOMM  = README request-assign-future.txt lisp/ doc/
-ORGFULL  = $(ORGCOMM) Makefile default.mk targets.mk etc/ contrib/ utils/
+ORGFULL  = $(ORGCOMM) Makefile default.mk targets.mk version.mk \
+		      etc/ contrib/ utils/
 ORGFULL := $(ORGFULL:%/=%/*)
 ORGELPA  = $(ORGCOMM) etc/styles/ org-pkg.el
 ORGELPA := $(ORGELPA:%/=%/*)
 
 release:	ORG_MAKE_DOC=info pdf card # do not make HTML documentation
-release:	cleanall doc autoloads rel-dirty
+release:	cleanall doc rel-dirty
 rel-dirty rel-up:	ORGDIR=org-$(GITVERSION:release_%=%)
-rel-dirty:
+rel-dirty rel-up:	ORGDIST=-dist
+rel-dirty:	 autoloads version.mk
 	-@$(RM) $(ORGDIR) $(ORGRTAR) $(ORGRZIP)
 	ln -s . $(ORGDIR)
 	tar -zcf $(ORGDIR).tar.gz $(foreach dist, $(ORGFULL), $(ORGDIR)/$(dist))
@@ -37,7 +39,7 @@ rel-dirty:
 	-@$(RM) $(ORGDIR)
 	$(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
 	    @$(MAKE) tagwarn)
-	@echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)
+	@echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
 rel-up:	rel-dirty
 	$(CP) $(ORGDIR).tar.gz $(ORGDIR).zip $(SERVROOT)/
 
@@ -48,7 +50,8 @@ PKG_REQ = "nil"
 elpa:		ORG_MAKE_DOC=info pdf card # do not make HTML documentation
 elpa:		cleanall doc elpa-dirty
 elpa-dirty elpa-up:	ORGDIR=org-$(PKG_TAG)
-elpa-dirty:	autoloads
+elpa-dirty elpa-up:	ORGDIST=-elpa
+elpa-dirty:	autoloads version.mk
 	-@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
 	ln -s . $(ORGDIR)
 	echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" >org-pkg.el
@@ -57,7 +60,7 @@ elpa-dirty:	autoloads
 	-@$(RM) $(ORGDIR) org-pkg.el
 	$(if $(filter-out $(ORGVERSION), $(GITVERSION)), \
 	    @$(MAKE) tagwarn)
-	@echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)
+	@echo ORGVERSION=$(ORGVERSION) GITVERSION=$(GITVERSION)$(ORGDIST)
 elpa-up:	elpa-dirty
 	$(CP) $(ORGDIR).tar $(SERVROOT)/pkg/daily/
 
@@ -70,9 +73,13 @@ tagwarn:
 	$(info  ======================================================)
 	@echo ""
 
-clean:	cleanrel
+version.mk:
+	@echo "ORGVERSION	?= $(ORGVERSION)"            > $@
+	@echo "GITVERSION	?= $(GITVERSION)$(ORGDIST)" >> $@
+
+cleanall clean:	cleanrel
 cleanrel:
-	$(RM) org-7.* org-20??????*
+	-$(RM) org-*.zip org-*.tar* version.mk
 
 doc-up:
 	$(MAKE) -C doc html manual guide