#**************************************************************************
#
#	FILE:
#		Makefile
#
#	Abstract: 
#		Makefile for commonly used system config library.
#
#	HISTORY:
#
#**************************************************************************

TARGET = libFVbase64
CROSS_COMPILE = $(PROJ_TARGET)-

CC = $(CROSS_COMPILE)gcc
OBJCOPY = $(CROSS_COMPILE)objcopy
STRIP = $(CROSS_COMPILE)strip
CFLAG = -fPIC -Wall -c -O -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
INCLUDE = -I../include
EXEC_PATH = $(PROJ_ROOT)/source/lib/bin

# To enable debug message dump, un-comment the following flag
#DEBUG_FLAG = -g -DDEBUG
NDEBUG = TRUE

OBJS =  base64.o util.o

all: 	libbase64

libbase64: $(OBJS)
	$(CC) $(LFS) -shared -Wl,-soname,$(TARGET).so -o $(TARGET).so $(OBJS) -lc $(LIB)

%.o : %.c
	$(CC) $(INCLUDE) $(CFLAG) $< -o $@ 

test: main.o
	$(CC) $(INCLUDE) main.c -o test -L../lib -lcfg -L. -lFVbase64

install:
	$(OBJCOPY) --strip-all $(TARGET).so
	install -d -m 755 $(EXEC_PATH)
	cp -av $(TARGET).so  $(EXEC_PATH)
	
clean:
	rm -f *.o 
	rm -f $(TARGET).so
	rm -f test
