gnu: fix soname creation.

Use only the basename, not directory component of $@, because that's
what the soname should be: just the file name.
Makefiles: fix default outputdir value.

By mistake the output directory was always equal to @srcdir, even when
the makefile was created in a different directory.  This was wrong, the
files should be built in the same directory where the makefile is.
Introduce bkl.api.BuildSubgraph.

Instead of using a list of BuildNodes with equal footing, return build
subgraphs as an object that clearly indicates which of the build nodes
is the main (primary) one and which nodes are secondary helpers, such as
compilation of individual object files.
Makefiles: don't list target's deps on all object files.

Don't add target's dependencies to all individual object files, keep
them on the main file only.  This greatly reduces makefiles size and is
the right thing to do.
gnu: implement rules with multiple outputs.
Makefiles: Handle conflicting object file names.

Handle the situation when the same makefile has more than one source
file with the same basename, but different directory. If this happens,
the object file name must be overwritten on per-file basis.

Do this automatically in Bakefile.
Fix enum_possible_values() to handle embedded lists correctly.
Output transitive deps and link flags in correct order.

Make sure the libraries and linker flags follow the order expected by
Unix linkers: dependencies are to the right of the dependents.
Add support for -fPIC compilation.
Add 'multithreading' property to support -pthread.