To prevent the incorrect module from loading you probably need to use preprocessor directives. However, this would require a separate compile for each mod. But, the advantage, in my opinion, is that the majority of code is going to be independent of the mod so having it all in one file is good for when you update non-mod specific code.