close fd on error
Generate doc with make doc