#
# Makefile for vMeta user library
#

ifeq "$(CONFIG_GEN_DEBUG)" "y"
VMETA_DEF := -DVMETA_DEBUG

else
VMETA_DEF := 
endif

SRC_DIR := .

CFLAGS += $(VMETA_DEF) \
	-I${SRC_DIR}/include \

vmeta_lib_src=${SRC_DIR}/vmeta_lib.c \

vmeta_lib_obj=${vmeta_lib_src:.c=.o} 

.PHONY: all compile install-host install-target clean clean-local \
	uninstall-host uninstall-target

.c.o:
	${CC} -fPIC -o $@ -c $<

all: compile install-host install-target 

compile: libvmeta.so libvmeta.a

libvmeta.a: ${vmeta_lib_obj}
	${AR} -rcs $@ ${vmeta_lib_obj}

libvmeta.so: ${vmeta_lib_obj}
	${CC} -g -s -shared -Wl,-soname,$@ -o $@ ${vmeta_lib_obj} -lbmm

clean: clean-local

clean-local:
	-rm -f ${vmeta_lib_obj}
	-rm -f libvmeta.*
