came across a beautiful page explaining the same thing..

http://www.adp-gmbh.ch/cpp/gcc/create_lib.html