[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: revision control info in generated files

From: Ralf Wildenhues
Subject: Re: revision control info in generated files
Date: Thu, 1 Apr 2010 20:31:43 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

* Jef Driesen wrote on Thu, Apr 01, 2010 at 02:34:29PM CEST:
> On 31/03/10 22:45, Ralf Wildenhues wrote:
> >* Jef Driesen wrote on Wed, Mar 31, 2010 at 02:49:48PM CEST:
> >>Shouldn't the .git-version file be created inside the build directory,
> >>rather than the source directory?
> >
> >No.  I want the .git-version file to be distributed, so that it is
> >present in an extracted tarball that has no .git information.  There,
> >the file will be in the source directory.  Might as well have it in the
> >source directory in my git checkout as well then, to be consistent;
> >otherwise, you may end up running into one of the 'make' portability
> >issues documented in info Autoconf 'Make Target Lookup'.
> Since the .git-version file is a generated file, I would think it
> belongs in the build directory, where all other generated files end
> up.

configure and files are generated files, too.

One simple rule one can follow and have few VPATH problems is to put all
files in the source tree which are added to the distribution.  And let
no distributed file depend on an undistributed file.

I'm not quite that strict; I have a couple of distributed files which
may be updated in a build tree.  But all files which also need special
tools (like git, makeinfo) to remake, and which are of course the same
across systems, are updated in the source tree.  I like to be able to
build from a git checkout on systems where these tools are not installed
(git may not be installed on all of the system that see an NFS mount).

> If I make a tarball (by running make distcheck) the version.c file
> is included too. But that file does not exist in the source
> directory, only in the build directory. So it doesn't seem to be a
> problem to distribute a file from the build directory.

Yes, sure.  The Automake-generated 'dist' rules go to some pains to
ensure that a file in the build tree is preferred over a file with the
same name in the source tree.  That's actually one of the reasons 'make
dist' is so slow.

> I do not understand everything that is explained in the 'Make Target
> Lookup' section, but it seems that not all make variants do build
> everything in the build directory? And that could cause problems?


> (Doesn't that cause trouble anyway when trying to use two different
> build directories with the same source directory?)

Not when done right.  :-)  When files in the source tree need update,
I usually run the first 'make' serially; the rest should cope with
read-only source tree.  Hmm.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]