Fix generate target file error