summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLea Li <lea.li@marvell.com>2010-05-07 17:10:36 +0800
committerLea Li <lea.li@marvell.com>2010-05-07 17:10:36 +0800
commit22df74ee8a0dfdb3cae2d581d014780ab5d06a65 (patch)
treea78d4a2fa12953ffef833b69ab220e5b7e3590b8
parenta7a3e19282f435f73d0d2c9151695e40cf9b3b7c (diff)
add Makefile
Signed-off-by: Lea Li <lea.li@marvell.com>
-rwxr-xr-xMakefile41
1 files changed, 41 insertions, 0 deletions
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.*