I wasn't aware of the print rule either, and came up with a somewhat convoluted solution which may be of help.
It's essentially just a bash script which generates the file in a destination made by mktemp, then compares the temporary file with the destination, and updates if necessary.
It has to be run in the Jamroot, not in a lower level Jamfile because jam globbing doesn't pick up the generated files in time if it's done in the Jamfile.
$ cat Jamroot
path-constant TOP : . ;
# generate current version information
# (done here because jam globbing doesn't pick up generated files on time if done in their respective jamfiles)