Rewrite build rules