Generate and cleanup LinkDef.h properly