Smake: Factor output repetitive code into new script in build-aux.