now, I got main.c, sub.h, sub.c, util.h, util.c.
how to compile main.bin?
#gcc -o main.bin *.c
how to compile sub.a?
#gcc -c -o sub.o sub.c
#ar r sub.a sub.o
how to compile sub.so?
#gcc -fpic -c -o sub.o sub.c
#gcc -shared -o sub.so sub.o
here is the original url