From 22df74ee8a0dfdb3cae2d581d014780ab5d06a65 Mon Sep 17 00:00:00 2001 From: Lea Li Date: Fri, 7 May 2010 17:10:36 +0800 Subject: add Makefile Signed-off-by: Lea Li --- Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 Makefile diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..5e9fe72 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +# +# 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} + +clean: clean-local + +clean-local: + -rm -f ${vmeta_lib_obj} + -rm -f libvmeta.* -- cgit