[ back to toc ]

Project organization - C program and Unix

Date: 2002/02/09 17:53

Q:
I have a project I am working on that when I opened the .tar file it
exploded in directories and I don't exactly understand the purpose of
using such a directory structure to work in. The structure is this:

from my home directory /project1:
/bin
/lib
/src
/include

from project1/src:
/bin
/lib

from project1/src/bin
/conv_to_cent
/conv_to_fahr

from project1/src/lib
/temp_conv
/arg

Now I understand what each of the directories contain, but what I don't
get is why I have to have a /lib and /bin directory under /project1 and
also under project1/src. An "install target" in a makefile ends up
copying the executables and libraries out of the projct1/src/ bin and lib
directories into the project1/lib and bin directories - duplicates!

Also why do libary files and executables get placed in different
directories, why can't they be in the same directory? Both executables
use the same library files.

Sorry if this is confusing, all these directories are confusing "ME!"

And one more thing about the install target in the library make file: it
uses the -s option. The install target for the executables makefile
doesn't.
install -c ${RELLIB} -s -m 775 ${LIB}
install -c ${RELBIN} -m 755 ${EXEC}

(RELLIB=../../../lib and RELBIN=../../../bin)
As far as I can tell from the man pages the -s option just means to
supress messages other than error messages so I don't see why you'd use
the option for a library and not an executable.
A:
*NAME-DELETED*!

Needless to say that the universe is more than what we can understand and
such is the programmer brain being part of it. You may feel, but may not
understand such a structure. If you developed that program, you would have
used a different structure. Another programmer used other structure. Do
not make more problems than those that you really have to solve.

I can easily imagine that install uses -s in once case, because the progra
mmer wanted tpo supress warnings, and not in the other just because he or
she simply forgot it.

I do not really see the importance of the directory structure in this
case.

Having files copied may have some reason in case during development you
may overwrite them, and still have the original.

Why do not you ask the developer, who organized this that way if you are
really curious and die unless to find out why the directory structure is
that way? Really. I am serious, I am not smiling, I mean it. Ask her (him)
being polite putting ladies first.

So I believe there is no reasom more than that is happened that way when
one programmed it.

Regards,
Peter

[ back to toc ]