# Sample create share and static library .

#AR=ar rc
#RANLIB=ranlib
#CC=gcc
#STRIP=strip

AR = arm-poky-linux-gnueabi-ar rc
RANLIB = arm-poky-linux-gnueabi-ranlib
CC = arm-poky-linux-gnueabi-gcc
STRIP = arm-poky-linux-gnueabi-strip

all:static shared

shared:	hellow.so
	$(CC) main.c -o $@ $?
	$(STRIP) $@

static: hellow.a
	$(CC) main.c -o $@ $?
	$(STRIP) $@	

hellow.a: hellow.o
	$(AR) $@  $?
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
	
hellow.so: hellow.c
	$(CC) -Wall -fPIC -c $?
	$(CC) -shared -o $@ hellow.o

hellow.o: hellow.c
	$(CC) -c $?  

install:
	#Please put hellow.so into /lib and run shared.

clean:
	rm -f static shared *.a *.o *.so
