mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
make: Use generic build engine for libcriu.so
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
c75c92db1d
commit
dfdac2cf3a
12
Makefile
12
Makefile
@ -126,12 +126,9 @@ ifeq ($(GCOV),1)
|
||||
%.o $(PROGRAM): override CFLAGS += --coverage
|
||||
endif
|
||||
|
||||
all: config pie $(VERSION_HEADER) lib
|
||||
all: config pie $(VERSION_HEADER) $(CRIU-LIB)
|
||||
$(Q) $(MAKE) $(PROGRAM)
|
||||
|
||||
lib: $(VERSION_HEADER)
|
||||
$(Q) $(MAKE) -C lib all
|
||||
|
||||
protobuf/%::
|
||||
$(Q) $(MAKE) $(build)=protobuf $@
|
||||
protobuf:
|
||||
@ -152,6 +149,11 @@ pie: arch/$(ARCH)
|
||||
built-in.o: $(VERSION_HEADER) pie
|
||||
$(Q) $(MAKE) $(build-crtools)=. $@
|
||||
|
||||
lib/%:: $(VERSION_HEADER) config built-in.o
|
||||
$(Q) $(MAKE) $(build)=lib $@
|
||||
lib: $(VERSION_HEADER) config built-in.o
|
||||
$(Q) $(MAKE) $(build)=lib all
|
||||
|
||||
PROGRAM-BUILTINS += pie/util-fd.o
|
||||
PROGRAM-BUILTINS += pie/util.o
|
||||
PROGRAM-BUILTINS += protobuf/built-in.o
|
||||
@ -176,11 +178,11 @@ clean-built:
|
||||
$(Q) $(MAKE) $(build)=arch/$(ARCH) clean
|
||||
$(Q) $(MAKE) $(build)=protobuf clean
|
||||
$(Q) $(MAKE) $(build)=pie clean
|
||||
$(Q) $(MAKE) $(build)=lib clean
|
||||
$(Q) $(MAKE) $(build-crtools)=. clean
|
||||
$(Q) $(MAKE) -C Documentation clean
|
||||
$(Q) $(RM) ./include/config.h
|
||||
$(Q) $(RM) ./$(PROGRAM)
|
||||
$(Q) $(MAKE) -C lib clean
|
||||
|
||||
rebuild: clean-built
|
||||
$(E) " FORCE-REBUILD"
|
||||
|
34
lib/Makefile
34
lib/Makefile
@ -1,13 +1,29 @@
|
||||
.PHONY: all clean
|
||||
obj-y += criu.o
|
||||
|
||||
all: libcriu.so
|
||||
cflags-y += -shared -fPIC -Wa,--noexecstack -fno-stack-protector
|
||||
LDFLAGS += --export-dynamic
|
||||
includes += -iquote $(obj)/../arch/$(ARCH)/include -iquote $(obj)/../include -iquote $(obj)/..
|
||||
|
||||
libcriu.so: criu.o
|
||||
$(Q) $(CC) $(CFLAGS) -shared -o $@ criu.o
|
||||
.SECONDARY:
|
||||
|
||||
criu.o:
|
||||
$(Q) $(CC) $(CFLAGS) -fPIC -c criu.c -I ../include/
|
||||
#
|
||||
# We need util-fd.c to be re-compiled with
|
||||
# own flags, but our build engine can't
|
||||
# do such tricks yet, so write a rule
|
||||
# manually for a while.
|
||||
$(obj)/util-fd.o: $(obj)/../pie/util-fd.c
|
||||
$(E) " CC " $@
|
||||
$(Q) $(CC) -c $(cflags-y) $(CFLAGS) $(includes) $< -o $@
|
||||
|
||||
clean:
|
||||
$(Q) $(RM) -f *.o
|
||||
$(Q) $(RM) -f *.so
|
||||
$(obj)/built-in.o: $(obj)/util-fd.o
|
||||
|
||||
$(obj)/libcriu.so: $(obj)/built-in.o
|
||||
$(E) " GEN " $@
|
||||
$(Q) $(CC) $(CFLAGS) -shared $^ -o $@
|
||||
|
||||
_all += $(obj)/built-in.o
|
||||
cleanup-y += $(obj)/*.so
|
||||
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
incdeps := y
|
||||
endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user