[PATCH v4] build: write VERSION file containing $(VERSION) string

W. Trevor King wking at tremily.us
Sat Feb 8 15:56:23 PST 2014


On Thu, Feb 06, 2014 at 12:58:33AM +0200, Tomi Ollila wrote:
> -VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
> +# Also write VERSION file in case its contents differ from $(VERSION)
> +VERSION:=$(shell\
> +	gv=`git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/`;\

Ew, backticks ;).  What about handling more of the logic in Make:

  VERSION := $(shell git describe …)
  FILE_VERSION := $(shell test -f VERSION || touch VERSION; cat VERSION)
  ifneq ($(FILE_VERSION), $(VERSION))
  	$(shell echo "$(VERSION)" > VERSION)
  endif

> +# Depend (also) on 'version' file. In case of ifeq ($(IS_GIT),yes)
> +# this file may already have been updated.
> +VERSION: version
> +	echo $(VERSION) > $@

Do we care about case-insensitive filesystems where VERSION will
collide with version?

> -CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc
> +CLEAN := $(CLEAN) VERSION notmuch notmuch-shared $(notmuch_client_modules)

Where did notmuch.elc go?

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20140208/f10dd7db/attachment.pgp>


More information about the notmuch mailing list