[geeks] UNIX development and makefile discussion

Jonathan Patschke jp at celestrion.net
Fri Aug 16 12:02:44 CDT 2013


On Fri, 16 Aug 2013, microcode at zoho.com wrote:

>> I then have a separate directory for each executable program that gets
>> built.  Maybe there's a server portion and a client portion.  Each of
>> those directories has "header files" that are used only within that
>> front-end versus the <header files> that are part of the library code.
>
> I understand the part about grouping related executables, but did you mean
> you have a separate directory for each executable? I mean that's what you
> seem to have written but I don't think I understand what you meant.

It actually is what I meant, to a degree.  Imagine you're an end-user
installing your project in binary-only form.  If there's a server part and
a client part, it's possible that those are separate packages.  Even if
those are the only two executables I ship, I'd be inclined to put those in
separate directories.  If nothing else, it makes finding something in
gitweb easier (and, if you're using Subversion, it makes tracking changes
MUCH easier).

I suspect that I've been influenced by the Unix source tree in this
regard, even if I don't tend to make my individual targets buildable from
their directories.

> I have to look into this more. From a distribution standpoint (not that
> it's relevant to what I'm working on now) libraries could be a real
> problem. For one guy developing stuff for his own use, libraries are
> annoying because the interface is compiler specific. (This is not
> C/C++).

Well, most languages that I've used have some sort of module system and a
module search path.  Even if the term "library" doesn't apply, there's an
analogous mechanism that serves the same purpose.

Language might influence your directory structure, though.  Java, Perl,
and Python all mandate that the directory tree reflect the module
namespace, to varying degrees.

-- 
Jonathan Patschke  |  "For a successful technology, reality must take
Elgin, TX          %   precedence over public relations, for nature
USA                |   cannot be fooled."           --Richard Feynman


More information about the geeks mailing list