modify extra file handling to reference them relatively if possible to make the generated code relocatable (#369)