[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Is there an ultimate solution for the build process/global revision number

From: Andreas Kostyrka <andreas_at_kostyrka.org>
Date: 2005-06-29 11:59:18 CEST

Ok, let's explain it in more details:

aboutbox.o: aboutbox.c
        CMDs

is the make notation that aboutbox.o is build from aboutbox.c via CMDs.

cc is the C compiler under Unix.

-DREVISION=value

defines a value as if #define REVISION value
had been there in the source code.

$(shell CMD)

is a way to tell GNU make to execute CMD and substitute the output in it's
place.

svn info .

gives the info for the current directory.

awk looks for the revision tag and just outputs it value.

Alternativly there is also the possibility to create sourcecode that could
be compiled from stdin. (if one would want to include the exact revisions
and or perhaps even the md5sum of all involved source files)

Andreas

On Wed, Jun 29, 2005 at 11:51:59AM +0200, Robert Schneider wrote:
> Hi Andreas,
>
>
> >
> > aboutbox.o: aboutbox.c
> > cc -DREVISION=$(shell svn info . | awk ' /^Revision:/ { print $2 } '
> > -c -o aboutbox.o aboutbox.c
> >
>
> Hard for me to interpret this since I'm a (just ;-) developer
> using windows. And I'm also not familiar with make, ant and
> so on. I am just on the way to establish a build process.
>
> Does this mean that you are building with your working copy?
> Why don't you use svnversion (.exe in windows)?
> Is aboutbox.c under version control what means that after
> building the file has got a changed state which you have to revert?
>
> Robert
>
>
>
>
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Andreas Kostyrka [mailto:andreas@kostyrka.org]
> > Gesendet: Mittwoch, 29. Juni 2005 11:37
> > An: Robert Schneider
> > Cc: users@subversion.tigris.org
> > Betreff: Re: Is there an ultimate solution for the build process/global
> > revision number
> >
> > Well, I cannot help you with the MS side of things, but in the Unix/C-C++
> > World
> > this is easiy solved by a make rule like:
> >
> > aboutbox.o: aboutbox.c
> > cc -DREVISION=$(shell svn info . | awk ' /^Revision:/ { print $2 } '
> > -c -o aboutbox.o aboutbox.c
> >
> > Problem solved :)
> >
> > Andreas
> > On Wed, Jun 29, 2005 at 09:08:08AM +0200, Robert Schneider wrote:
> > > (This is my very first posting to a mailing list. Hope it works.)
> > >
> > > Hi to everyone,
> > >
> > > I am still confused how to deal with a build process
> > > and the global revision numbers. I have had expected
> > > that this is standard problem with a standard
> > > solution. I guess every software developer must meet
> > > this problem, or not?
> > >
> > > What do I want:
> > > 1) A nice build process.
> > > 2) The revision number in an info or about box
> > > (what implicates that this number has to be included
> > > within the source code)
> > >
> > > Is this something special? I don't think so. The problem
> > > should be independent from the used programming language
> > > and the OS (I use VB6 and VB8 under Windows if anyone
> > > is interested...).
> > >
> > > So what is the BEST practice. Surely there a several
> > > Approaches but I would like to know the perfect one, if
> > > possible.
> > >
> > > Questions:
> > > Is it better to use svn-exported files for a build?
> > > It the use of the SubWCRev.exe a good idea or is it even
> > > necessary?
> > > If I have to use the working copy how can I avoid that
> > > the source file with the revision number gets a changed
> > > state so I have to revert that file?
> > > Can I cleanly separate the build process from subversion?
> > > Or does the use of subversion causes a special build
> > > process?
> > >
> > >
> > > So how does it look like, the perfect solution? Or are
> > > there only workarounds?
> > >
> > > If there is a standard solution this should be placed
> > > within the faq. If this is the solution:
> > > http://subversion.tigris.org/faq.html#version-value-in-source
> > > then I did not understand it. Would be nice to change it
> > > to a abstract description without the make example.
> > >
> > > Are there any plans to enhance subversion so that the
> > > svnversion command works also directly with the repository?
> > > I don't understand why it only works with working copy.
> > >
> > >
> > > I appreciate any help!
> > >
> > > Robert Schneider
> > > (from Austria)
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> > > For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 29 12:01:17 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.