This is horrible.  You shouldn't need to do this here, the build system should do it for you.