I have the following Jamfile which installs my binary as binary.version (ie: it adds additional information to the name of the binary)

constant EXE : my_app ;

exe $(EXE) : [ glob *.cpp ] ;

install install-target : $(EXE) : <location>. ;

notfile . : @tag-file : install-target : ;
actions tag-file
{
    mv $(>) $(>).$(VERSION) 
}

It works, but is a little klunky:

1. install-target and tag-file action are duplicated in every Jamfile which needs them. I would like to put this in the Jamroot, but simply moving it doesn't work (I think because it depends on the current path and target name) - is there any way to create a rule/aciton like this which can live in the Jamroot and be called from Jamfiles?

2. every time I build, it will always call the tag-file action, instead of only when the exe target is rebuilt. How can I make my tag-file action only run when the exe is updated?