mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
build: Move C and Python libraries into lib
Both CRIU library and CRIT python data are moved into lib/c and lib/py. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
f07970ae7b
commit
da0eb1483b
18
Makefile
18
Makefile
@ -162,7 +162,7 @@ CFLAGS += $(WARNINGS) $(DEFINES)
|
|||||||
SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
|
SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
|
||||||
ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o
|
ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o
|
||||||
CRIU-SO := libcriu
|
CRIU-SO := libcriu
|
||||||
CRIU-LIB := lib/$(CRIU-SO).so
|
CRIU-LIB := lib/c/$(CRIU-SO).so
|
||||||
CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto
|
CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto
|
||||||
ifeq ($(piegen-y),y)
|
ifeq ($(piegen-y),y)
|
||||||
piegen := pie/piegen/piegen
|
piegen := pie/piegen/piegen
|
||||||
@ -225,9 +225,15 @@ built-in.o: $(VERSION_HEADER) pie
|
|||||||
$(Q) $(MAKE) $(build-old-crtools)=. $@
|
$(Q) $(MAKE) $(build-old-crtools)=. $@
|
||||||
|
|
||||||
lib/%:: $(VERSION_HEADER) config built-in.o
|
lib/%:: $(VERSION_HEADER) config built-in.o
|
||||||
$(Q) $(MAKE) $(build-old)=lib $@
|
$(Q) $(MAKE) -C lib $@
|
||||||
lib: $(VERSION_HEADER) config built-in.o
|
lib: $(VERSION_HEADER) config built-in.o
|
||||||
$(Q) $(MAKE) $(build-old)=lib all
|
$(Q) $(MAKE) -C lib all
|
||||||
|
|
||||||
|
$(CRIU-LIB): lib
|
||||||
|
@true
|
||||||
|
crit: lib
|
||||||
|
@true
|
||||||
|
|
||||||
|
|
||||||
PROGRAM-BUILTINS += protobuf/built-in.o
|
PROGRAM-BUILTINS += protobuf/built-in.o
|
||||||
PROGRAM-BUILTINS += built-in.o
|
PROGRAM-BUILTINS += built-in.o
|
||||||
@ -238,9 +244,6 @@ $(PROGRAM): $(ARCH-LIB) $(PROGRAM-BUILTINS)
|
|||||||
$(E) " LINK " $@
|
$(E) " LINK " $@
|
||||||
$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
|
$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
|
||||||
|
|
||||||
crit:
|
|
||||||
$(Q) $(MAKE) -C pycriu all
|
|
||||||
|
|
||||||
zdtm: all
|
zdtm: all
|
||||||
$(Q) $(MAKE) -C test/zdtm all
|
$(Q) $(MAKE) -C test/zdtm all
|
||||||
|
|
||||||
@ -253,7 +256,7 @@ clean-built:
|
|||||||
$(Q) $(MAKE) $(build-old)=protobuf clean
|
$(Q) $(MAKE) $(build-old)=protobuf clean
|
||||||
$(Q) $(MAKE) $(build-old)=pie/piegen clean
|
$(Q) $(MAKE) $(build-old)=pie/piegen clean
|
||||||
$(Q) $(MAKE) $(build-old)=pie clean
|
$(Q) $(MAKE) $(build-old)=pie clean
|
||||||
$(Q) $(MAKE) $(build-old)=lib clean
|
$(Q) $(MAKE) -C lib clean
|
||||||
$(Q) $(MAKE) $(build-old-crtools)=. clean
|
$(Q) $(MAKE) $(build-old-crtools)=. clean
|
||||||
$(Q) $(MAKE) -C Documentation clean
|
$(Q) $(MAKE) -C Documentation clean
|
||||||
$(Q) $(RM) ./include/config.h
|
$(Q) $(RM) ./include/config.h
|
||||||
@ -273,7 +276,6 @@ clean: clean-built
|
|||||||
$(Q) $(RM) -r ./gcov
|
$(Q) $(RM) -r ./gcov
|
||||||
$(Q) $(RM) protobuf-desc-gen.h
|
$(Q) $(RM) protobuf-desc-gen.h
|
||||||
$(Q) $(MAKE) -C test $@
|
$(Q) $(MAKE) -C test $@
|
||||||
$(Q) $(MAKE) -C pycriu $@
|
|
||||||
$(Q) $(RM) ./*.pyc
|
$(Q) $(RM) ./*.pyc
|
||||||
$(Q) $(RM) -r build
|
$(Q) $(RM) -r build
|
||||||
$(Q) $(RM) -r usr
|
$(Q) $(RM) -r usr
|
||||||
|
48
lib/Makefile
48
lib/Makefile
@ -1,14 +1,42 @@
|
|||||||
lib-so += $(CRIU-SO)
|
include $(__nmk_dir)/include.mk
|
||||||
obj-y += criu.o
|
include $(__nmk_dir)/macro.mk
|
||||||
obj-ext-src-y += protobuf/rpc.pb-c.o
|
|
||||||
|
|
||||||
includes += -iquote $(obj)/../$(ARCH_DIR)/include -iquote $(obj)/../include -iquote $(obj)/.. -iquote $(obj)/../protobuf
|
VERSION_SO_MAJOR := 1
|
||||||
cflags-y += $(includes) -fPIC -Wa,--noexecstack -fno-stack-protector
|
VERSION_SO_MINOR := 0
|
||||||
cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR)
|
|
||||||
|
CRIU_SO := libcriu.so
|
||||||
|
|
||||||
|
#
|
||||||
|
# C language bindings.
|
||||||
|
c/%:
|
||||||
|
$(call msg-gen, $@)
|
||||||
|
$(Q) $(MAKE) $(build)=c $@
|
||||||
|
c/built-in.o:
|
||||||
|
$(call msg-gen, $@)
|
||||||
|
$(Q) $(MAKE) $(build)=c all
|
||||||
|
|
||||||
|
ccflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR)
|
||||||
ldflags-so += -lprotobuf-c
|
ldflags-so += -lprotobuf-c
|
||||||
|
c/$(CRIU_SO): c/built-in.o
|
||||||
|
$(call msg-link, $@)
|
||||||
|
$(Q) $(CC) -shared $(ccflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
|
||||||
|
lib-c: c/$(CRIU_SO)
|
||||||
|
PHONY += lib-c
|
||||||
|
|
||||||
.SECONDARY:
|
#
|
||||||
|
# Python bindings.
|
||||||
|
lib-py:
|
||||||
|
$(call msg-gen, $@)
|
||||||
|
$(Q) $(MAKE) -C py/images all
|
||||||
|
PHONY += lib-py
|
||||||
|
|
||||||
ifneq ($(MAKECMDGOALS),clean)
|
clean:
|
||||||
incdeps := y
|
$(call msg-clean, lib-c)
|
||||||
endif
|
$(Q) $(MAKE) $(build)=c $@
|
||||||
|
$(Q) $(RM) c/$(CRIU_SO)
|
||||||
|
$(call msg-clean, lib-py)
|
||||||
|
$(Q) $(MAKE) -C py/images $@
|
||||||
|
|
||||||
|
all: $(PHONY)
|
||||||
|
@true
|
||||||
|
PHONY += all
|
||||||
|
13
lib/c/Makefile
Normal file
13
lib/c/Makefile
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
obj-y += criu.o
|
||||||
|
obj-y += $(SRC_DIR)/images/rpc.pb-c.o
|
||||||
|
|
||||||
|
ccflags-y += -iquote $(SRC_DIR)/crtools/$(ARCH_DIR)/include
|
||||||
|
ccflags-y += -iquote $(SRC_DIR)/crtools/include -iquote $(obj)/..
|
||||||
|
ccflags-y += -iquote $(SRC_DIR)/images
|
||||||
|
ccflags-y += -fPIC -Wa,--noexecstack -fno-stack-protector
|
||||||
|
|
||||||
|
#
|
||||||
|
# Remove once criu moved into proper place.
|
||||||
|
ccflags-y += -iquote $(SRC_DIR)/$(ARCH_DIR)/include
|
||||||
|
ccflags-y += -iquote $(SRC_DIR)/include -iquote $(obj)/..
|
||||||
|
ccflags-y += -iquote $(SRC_DIR)/images
|
0
pycriu/.gitignore → lib/py/.gitignore
vendored
0
pycriu/.gitignore → lib/py/.gitignore
vendored
Loading…
x
Reference in New Issue
Block a user