Reorganize compile script