This example project creates an executable named prog from the source files main.c, prog1.c, prog2.c and prog3.c.
prog is linked against libmystaticlib.a and libmydynlib.so which are also built from source, and against the external library libstuff.a in stuff/lib with a header in stuff/include. 
The shared library libmydynlib.so is compiled with position independent code.
Before building the program, you need to rename the correct library in stuff/lib to libstuff.a!
How to build with make:
   cd make_cmake 
   make -f Makefile.in    (or, for debugging: make debug -f Makefile.unix)

How to build with cmake:
   cd make_cmake
   mkdir build
   cd build
   cmake ..		    (or, for debugging: cmake -DCMAKE_BUILD_TYPE:STRING=Debug)	   
   make

you can also use cmake directly in the source directory (although this is uncommon):
   cd make_cmake
   cmake .
   make