[M] Change in osmo-dev[master]: gen_makefile: write content into a buffer first