This is possibly doable but there are a couple of things id like to ask,
Whats your code doing (is it possible to post some up so we can have a look at it) we might be able to come up with a better way of solving your problem, i.e. error handling OOP etc
What is difference between the cases that you need to recompile, this doesn't sound like a good idea