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

Tomi Ollila tomi.ollila at iki.fi
Sun Feb 9 00:26:50 PST 2014


On Sun, Feb 09 2014, "W. Trevor King" <wking at tremily.us> wrote:

> 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

Sure makes that clearer...

>
>> +# 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?

Very good point! We do not wan't to have a chance to overwrite version
... I have to look a new filename for that...

>
>> -CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc
>> +CLEAN := $(CLEAN) VERSION notmuch notmuch-shared $(notmuch_client_modules)
>
> Where did notmuch.elc go?

To emacs/notmuch.elc years ago.

>
> Cheers,
> Trevor

Thanks for review.

Tomi


More information about the notmuch mailing list