Arranging Multi-Language Source Code Trees?
jodonn queries: "Often software developers are called upon to write code in multiple languages for a single project. For instance, I've had to write Java applications with C hooks into legacy native applications and batch processes primarily in C++ with some additional code in Perl, and of course I have to support the build process for all these things, often across platforms using Make and Ant. I'd like to hear some tips about best practices when laying out the source code hierarchy for situations like these, with an eye toward ease in compiling and deployment."
In general, I'd suggest basing the heirarchy on functionality.... something along the lines of "node_type/functional_area/process/{main|libs}/*". Sure, there are difficulties with that too, but symbolic links are a good thing! ;)
Although a bad tree is difficult, the most painful thing I've encountered is how the 'product' is released. That you need to specify that up front, that everything is built in it's own dir, but installs itself into a "release" area, that can be tarred up/archived/copied as necessary. To be fair, it depends a lot on your product, but I hate it when there isn't a release process, you just have to know the files, and where to copy them... bleck.
babble... babble.
"Why should I be content to simply live in this world, when I, as a human being, can CREATE it?" - Oertel
Why not just place all your source in a single directory, and instead of worrying about makefiles, get an intern to take care of all your compilation?
my sig's at the bottom of the page.
You should group source code by build target.
E.g. For the Java/C application, the C code generally builds to a dynamic library (a DLL or .so), while the Java code probably builds to a .jar file or such. These are nicely independent build targets, so they should be in separate directories.
Hopefully your project is well architected at a high level, and each of the build targets is semi-autonomous. Every directory should contain a chunk of code that can be tested semi-independently. If your project doesn't work this way, you need to refactor.
Andrew Wiles
a**n + b**n != c**n for n > 2