Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-08-26 01:34:51


Hi John,

> I'm currently using Boost Build v1 for some of my projects. I must say,
> it's significantly better than Makefiles. Overall, I'm quite pleased,
> though it took a little while to learn.
>
> I haven't been able to figure out one thing, though. How to generate
> custom built targets. Basically, I want to auto-generate a C++ source
> file so that I can keep track of version information.
>
> I have a python script that determines the version information from
> various sources (such as the revision control system [arch]), and I
> would like it to be run before my library is built.
>
> If I was using a makefile I would do something like this:
>
> .PHONY: version.cpp
>
> version.cpp: generate_version.py version
> ./generate_version.py
>
> This would cause version.cpp to be generated fresh each time the build
> process was called. However, I don't really need the ".PHONY", it would
> be okay if it was only created whenever one of the other files changed.

You mean, it's OK to rebuild version.cpp only if either
'generate_version.py' or 'version' change? In Boost.Build *V2* this can be
done with:

   exe a : a.cpp version.cpp ;

   make version.cpp : script.py version : $(__name__).update-version ;

   actions update-version
   {
       $(>[1]) -o $(<) $(>[2])
   }

For V1, I think you'd need to create a new main target rule and I have no
idea how hard is it.

> Thanks,
> John
> =:->
>
> PS> Is there a better mailing list for this?

Yea, jamboost_at_[hidden], see
http://boost.org/more/mailing_lists.htm#projects

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net