[CRIU] [PATCH]v4 criu: Initial skeleton for criu library

Ruslan Kupreev kupruser at gmail.com
Sun Jul 21 19:00:25 EDT 2013


Hello all!

I make an initial skeleton for CRIU library. It will be used to add 
different useful functionality.

-- 
Signed-off-by: Ruslan Kupreev kupruser at gmail.com <mailto:kupruser at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20130722/19acf08f/attachment.html>
-------------- next part --------------
commit becfb56025a5d15f45141b66d43b10734295b860
Author: Ruslan Kupreev <kupruser at gmail.com>
Date:   Mon Jul 22 01:38:24 2013 +0300

    Added initial skeleton for criu library.

diff --git a/Makefile b/Makefile
index aabfded..71ceee9 100644
--- a/Makefile
+++ b/Makefile
@@ -119,15 +119,18 @@ build-crtools := -r -R -f scripts/Makefile.build makefile=Makefile.crtools obj
 PROGRAM		:= criu
 
 .PHONY: all zdtm test rebuild clean distclean tags cscope	\
-	docs help pie protobuf arch/$(ARCH) clean-built
+	docs help pie protobuf arch/$(ARCH) clean-built lib
 
 ifeq ($(GCOV),1)
 %.o $(PROGRAM): override CFLAGS += --coverage
 endif
 
-all: config pie $(VERSION_HEADER)
+all: config pie $(VERSION_HEADER) lib
 	$(Q) $(MAKE) $(PROGRAM)
 
+lib: $(VERSION_HEADER)	
+	$(Q) $(MAKE) -C lib all
+
 protobuf/%::
 	$(Q) $(MAKE) $(build)=protobuf $@
 protobuf:
@@ -175,6 +178,7 @@ clean-built:
 	$(Q) $(MAKE) -C Documentation clean
 	$(Q) $(RM) ./include/config.h
 	$(Q) $(RM) ./$(PROGRAM)
+	$(Q) $(MAKE) -C lib clean
 
 rebuild: clean-built
 	$(E) "  FORCE-REBUILD"
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644
index 0000000..bdbe1c6
--- /dev/null
+++ b/lib/Makefile
@@ -0,0 +1,13 @@
+.PHONY: all clean
+
+all: libcriu.so
+
+libcriu.so: criu.o
+	$(Q) $(CC) $(CFLAGS) -shared -o $@ criu.o
+
+criu.o: 
+	$(Q) $(CC) $(CFLAGS) -fPIC -c criu.c -I ../include/
+
+clean:
+	$(Q) $(RM) -f *.o
+	$(Q) $(RM) -f *.so
diff --git a/lib/criu.c b/lib/criu.c
new file mode 100644
index 0000000..196d2dc
--- /dev/null
+++ b/lib/criu.c
@@ -0,0 +1,3 @@
+#include "version.h"
+
+const char* criu_lib_version = version;


More information about the CRIU mailing list