make_directory (system.c) should have been static
Add _ty_ prefix to some library-private symbols
Don't build source files twice for static and shared libraries

Use cmake's object library type introduced in CMake 2.8.8 to use the
same objects for the static and shared libraries.
Use dynamic linking for the CLI binary by default

Option STATIC_BINARIES is added to CMakeLists.txt to use static linking
like it was done before this.
Use -fvisibility=hidden to hide symbols by default

TY_PUBLIC is defined to __attribute__((__visibility__("default"))).
Exported symbols should be marked with it in their declaration.