Search code examples
makefilebazaar

How to make dependency in makefile so that target is built when bazaar revision changes?


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 config.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?


Solution

  • 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