2016-02-15 15:26:53 +03:00
|
|
|
include $(__nmk_dir)/include.mk
|
|
|
|
include $(__nmk_dir)/macro.mk
|
2013-07-18 21:47:11 +04:00
|
|
|
|
2016-02-15 15:26:53 +03:00
|
|
|
CRIU_SO := libcriu.so
|
2016-02-18 17:13:00 +03:00
|
|
|
UAPI_HEADERS := c/criu.h ../images/rpc.proto
|
2016-02-15 15:26:53 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# C language bindings.
|
2016-02-18 12:43:28 +03:00
|
|
|
c/%: ../Makefile.versions
|
2016-02-15 15:26:53 +03:00
|
|
|
$(call msg-gen, $@)
|
|
|
|
$(Q) $(MAKE) $(build)=c $@
|
|
|
|
|
2016-02-18 12:43:28 +03:00
|
|
|
cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR)
|
2013-12-18 01:04:38 +04:00
|
|
|
ldflags-so += -lprotobuf-c
|
2016-02-15 15:26:53 +03:00
|
|
|
c/$(CRIU_SO): c/built-in.o
|
|
|
|
$(call msg-link, $@)
|
2016-02-15 15:26:55 +03:00
|
|
|
$(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
|
2016-02-15 15:26:53 +03:00
|
|
|
lib-c: c/$(CRIU_SO)
|
2016-03-10 22:19:51 +03:00
|
|
|
.PHONY: lib-c
|
2016-02-15 15:26:53 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Python bindings.
|
|
|
|
lib-py:
|
|
|
|
$(call msg-gen, $@)
|
2016-02-19 19:29:00 +03:00
|
|
|
$(Q) $(MAKE) -C py all
|
2016-03-10 22:19:51 +03:00
|
|
|
.PHONY: lib-py
|
|
|
|
|
|
|
|
all: lib-c lib-py
|
|
|
|
@true
|
|
|
|
.PHONY: all
|
2013-07-18 21:47:11 +04:00
|
|
|
|
2016-02-15 15:26:53 +03:00
|
|
|
clean:
|
|
|
|
$(call msg-clean, lib-c)
|
|
|
|
$(Q) $(MAKE) $(build)=c $@
|
|
|
|
$(Q) $(RM) c/$(CRIU_SO)
|
2016-02-18 17:13:00 +03:00
|
|
|
$(Q) $(RM) c/criu.pc
|
2016-02-15 15:26:53 +03:00
|
|
|
$(call msg-clean, lib-py)
|
2016-02-19 19:29:00 +03:00
|
|
|
$(Q) $(MAKE) -C py $@
|
2016-03-11 03:00:00 +03:00
|
|
|
$(Q) $(RM) -r build usr
|
2016-03-10 22:19:51 +03:00
|
|
|
.PHONY: clean
|
2016-02-15 15:26:55 +03:00
|
|
|
|
2016-02-18 17:13:00 +03:00
|
|
|
install: lib-c lib-py ../crit/crit c/criu.pc.in
|
|
|
|
$(E) " INSTALL " $(CRIU_SO)
|
|
|
|
$(Q) mkdir -p $(DESTDIR)$(LIBDIR)
|
|
|
|
$(Q) install -m 755 c/$(CRIU_SO) $(DESTDIR)$(LIBDIR)/$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR).$(CRIU_SO_VERSION_MINOR)
|
|
|
|
$(Q) ln -fns $(CRIU_SO).$(CRIU_SO_VERSION_MAJOR).$(CRIU_SO_VERSION_MINOR) $(DESTDIR)$(LIBDIR)/$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR)
|
|
|
|
$(Q) ln -fns $(CRIU_SO).$(CRIU_SO_VERSION_MAJOR).$(CRIU_SO_VERSION_MINOR) $(DESTDIR)$(LIBDIR)/$(CRIU_SO)
|
|
|
|
$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
$(Q) install -m 644 $(UAPI_HEADERS) $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
$(E) " INSTALL " pkgconfig/criu.pc
|
|
|
|
$(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
|
|
|
|
$(Q) sed -e 's,@version@,$(CRIU_VERSION),' -e 's,@libdir@,$(LIBDIR),' -e 's,@includedir@,$(dir $(INCLUDEDIR)),' c/criu.pc.in > c/criu.pc
|
|
|
|
$(Q) install -m 644 c/criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
|
|
|
|
$(E) " INSTALL " crit
|
|
|
|
$(Q) python ../scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
|
|
|
|
.PHONY: install
|
2016-04-20 12:11:52 +03:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
$(E) " UNINSTALL" $(CRIU_SO)
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBDIR)/,$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR))
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBDIR)/,$(CRIU_SO))
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBDIR)/,$(CRIU_SO).$(CRIU_SO_VERSION_MAJOR).$(CRIU_SO_VERSION_MINOR))
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(INCLUDEDIR)/,$(notdir $(UAPI_HEADERS)))
|
|
|
|
$(E) " UNINSTALL" pkgconfig/criu.pc
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBDIR)/pkgconfig/,criu.pc)
|
|
|
|
$(E) " UNINSTALL" crit
|
|
|
|
#
|
|
|
|
# FIXME How to deal with python setup properly?
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(BINDIR)/,crit)
|
|
|
|
$(Q) $(RM) -r $(addprefix $(DESTDIR)$(LIBDIR)/python2.7/site-packages/,pycriu)
|
|
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBDIR)/python2.7/site-packages/,crit-0.0.1-py2.7.egg-info)
|
|
|
|
# $(Q) python ../scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
|
|
|
|
.PHONY: uninstall
|