[PATCH] Generate/update a version.h header file.

Dirk Hohndel dirk at hohndel.org
Tue Feb 26 09:46:24 PST 2013


Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn at axis.com> writes:

> On Tue, 26 Feb 2013, Lubomir I. Ivanov wrote:
>>
>> >  GET_VERSION = ./scripts/get-version
>> >  VERSION_STRING := $(shell $(GET_VERSION) linux || echo "v$(VERSION)")
>> > @@ -157,7 +163,13 @@ OBJS =     main.o dive.o time.o profile.o info.o equipment.o divelist.o deco.o plann
>>
>> sorry, this a on a quick look....does it handle the "not in a git
>> repository" case (e.g. tarballs) ?
>> my attempt also handled the "no tags" case via "No names found" string check.
>
> It should handle that, as the ./scripts/get-version will 'exit 1'.
>
>> >  clean:
>> > -       rm -f $(OBJS) *~ $(NAME) $(NAME).exe po/*~ po/subsurface-new.pot
>> > +       rm -f $(OBJS) *~ $(NAME) $(NAME).exe po/*~ po/subsurface-new.pot \
>> > +               $(VERSION_FILE)
>> >         rm -rf share .dep
>>
>> a potential problem at "clean".
>> we may want to keep the version file in case of tarball distributions,
>> so it should not be deleted, but simply overridden i'd think.
>> this way the tarball will come with a version that will not depend on
>> git and the Makefile should not change it.
>> or do i miss something here?
>
> Hmm...  Dirk's call?

I really don't want the tar ball to include things that aren't in the
git tree. Because the way I create the tar ball is "git archive" :-)

So what I really want is for the Makefile to create the version.h file
with the VERSION from the Makefile

/D


More information about the subsurface mailing list