I have a script that is designed to generate a config.h in the source tree, to be used by the code at compile-time. Information included in this includes the bazaar revision number.
My project is based only on a Makefile. I would like to add con开发者_如何学编程fig.h as a target to be built when the script to make config.h is changed or the bazaar revision changes.
Is there a file in the .bzr directory that would change when the revision changes or something else I could use to get this type of dependency?
As Steven said you might use last-revision file.
But as another approach you can consider to use post_change_branch_tip hook, and call build script for config.h automatically every time branch tip is changed.
http://doc.bazaar-vcs.org/bzr.2.0.0/en/user-reference/index.html#post-change-branch-tip
It looks like .bzr/branch/last-revision has what you want...
EDIT: To properly handle the case of building past revisions, it honestly might just be easier to rebuild the config file every time you do a build, especially if it doesn't take too long...
精彩评论