The last few days have been too hot / busy / drunken to get any useful coding done on this project.
However, tomorrow I'm going to start designing the makefile(s) for the compilation / linking of the various modules together.
As I've said previously, I'm going to have the default make target (of each individual module) perform the compilation (-c) of the object files. A secondary (recessive) target will be called "standalone" and will perform a full compilation to an executable for that particular module.
This means I can easily unit-test each module separately from the main application. This will be most useful for valgrind and gdb debugging. To handle special cases where the actual code needs to be different (for instance, providing a main() function) the standalone targets will all provide
#define STANDALONE, which will let the compiler make sense of the code for its module. The master makefile may also have a standalone target that makes all of the standalone binaries all at once, although this will be of limited usefulness apart from code-sanity testing.
This will undoubtedly get a bit complex later on in the development. I'm not sure how I'll get around the pipe comms issues in the standalone versions but I'll burn that bridge when I come to it.
the makefiles will be arranged in a tree, one master makefile in the top-level directory and then another makefile for each module inside that module's code folder. This will allow all the standalones to be segregated away from each other and should minimize makefile rot, as most of the sub-makefiles will be almost identical to each other and therefore can easily be repaired / recovered. This will be a bit more work but in the long run should save some dependency hassles.