export: rewrite and use build tree's own export procedure.