Rewrite compile script