INC=../inc
LIB=../lib
TYPE=a
FLAG=
NAME=

all : test.o libtest.$(TYPE) $(INC)/test.h
        gcc -o test $(NAME) test.c -L$(IB) -ltest -I$(INC)

test.o : test.c $(INC)/test.h
        gcc -c test.c -I$(INC)

libtest.so : test01.c test02.c $(INC)/test.h
        gcc -fPIC -c test01.c test02.c -I$(INC)
        gcc -shared -W1,-soname,libtest.so.1 -o libtest.so.1.0.1 test01.o test02.o
        mv libtest.so.1.0.1 $(LIB)
        ln -s /home/test/lib/libtest.so.1.0.1 $(LIB)/libtest.so
        ls -al $(LIB)

libtest.a : test01.o test02.o
        ar rs libtest.a test01.o test02.o
        ar t libtest.a
        mv libtest.a $(LIB)

test01.o : test01.c $(INC)/test.h
        gcc -c test01.c -I$(INC)

test02.o : test02.c ../inc/test.h
        gcc -c test02.c -I../inc

clean :
        rm -rf *.o
        rm -rf $(LIB)/*.*