Separating modules into different components
Hey,
I'm trying to separate some commonly used modules - for instance, a full socket server.
I've put everything into individual folders and am creating Makefiles for each folder (this is a Linux server, btw). The problem is, the Server component needs to call an object which is used in every project as the 'event handler' so to speak - an event processing the command the client has said. Not only that, but occasionally the programs logic will need to send commands to the client at its will - not initiated by a client event (such as a regular ping, or a new message).
I want to somehow create - and preferably compile - the entire server module in to .o files ready for full linking to the project in question. Then, be able to iteratively go through the recompile all projects that rely on said Server module without editing them - AND without having the server need to be modified for each project.
Is there another way other than a common 'interface' object that must be created to talk between the Server and the rest of the program? This would require a class within the Server folder that can be used for communication between Server and the program. Also, is there a way to compile just classes that have no implementation (ie, are missing a main() function)?
Basically - is my logic here correct or is there some super-elegant way I could be doing this?
Cheers!