diff options
-rwxr-xr-x | Makefile | 41 |
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.* |