build-sys: keep intermediate files

Sometimes it is useful to look at them, and they don't take
up any significant amount of space. Keeping them also avoids
the message about files being removed at the end of make
run.
build-sys: inline two definitions which were only used in one place