Why does Makefile depend on version.c?

Mark Mitchell mark@codesourcery.com
Tue Jul 22 19:47:00 GMT 2003


On Tue, 2003-07-22 at 12:12, Joseph S. Myers wrote:
> On Tue, 22 Jul 2003, Mark Mitchell wrote:
> 
> > It's hard for me to see why changing the version number requires these
> > things to be rebuilt.
> 
> It's used for the definition of libsubdir in the Makefile, and for the
> header in the generated manpages, but I suppose you're looking for
> something less obvious.

Let me ask it a different way.  

In Makefile.in we have:

gcc_version=@gcc_version@
gcc_version_trigger=@gcc_version_trigger@
version=$(gcc_version)
mainversion=`grep version_string $(srcdir)/version.c | sed -e
's/.*\"\([0-9]*\.[0-9]*\).*/\1/'`

Since we are willing to set Make variables based on shell commands that
look at version.c, why have configure actually substitute gcc_version? 
Right now, configure reads version.c and then does AC_SUBST into
gcc_version.  That means that an update that brings in a new version.c
causes a Makefile rebuild, which seems pointless.  By just having the
Makefile read the file we could avoid that.

Does that sound OK to you?

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com



More information about the Gcc mailing list