c3d/build

LIBRARIES is assuming directory and library are named the same thing

Closed this issue · 3 comments

I have specified LIBRARIES like this:

LIBRARIES=some/path/src

Which results in this error:

gcc: error: build/objects/linux/opt/src.a: No such file or directory

On the other hand, if I do this:

LIBRARIES=some/path/src/foo.lib

This result in the following error:

cd: some/path/foo.lib: No such file or directory

You seem to have settled on a convention that directories are specified with trailing slash. In which case it should also apply to library specifications I would think. However, I should point out that the convention of requiring ending "/" for directories will likely cause pain down the road if build begins to see wider adoption because that is typically not expected. Moving the semantics for that sort of thing to the variable name itself would be more conventional.

c3d commented

LIBRARIES is intended to be used in hierarchical projects which have many components. So the correct usage is to specify the name of a directory foo/bar that will build something called bar.lib. This is a build time optimization, where bar.lib will only be rebuilt if not present, unless you to something like make deep-debug, which will do a "deep" build and rebuild all libraries.

I added a commit illustrating this usage here: 9165e92.

c3d commented

As for the trailing / in paths, it's the simplest way for makefile rules that apply to directories, e.g. the rules to create these directories.

c3d commented

I did not hear back from you on these topics. I close the thread for now. If this is not satisfactory to you, please feel free to reopen. Thanks.