2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00
criu/Makefile.install
Dmitry Safonov 7a3604845d build/make: return to make from top directory
It looks like, there is not so much that needs to be fixed for
building criu from a top directory.
After the patch it's possible to do `make criu/mount.o` i.e.
It will build protobuf, compel as dependencies (if they are not built),
but no more from criu objects. If something breaks, you can
do make from vim and jump to error. Nice.
Mostly the patch corrects pathes to objects - I tried to make them
depend on $(obj) or $(SRC_DIR)/criu, where it's possible.

After it tested:
`make -j 10`, `make criu/log.o`, `make clean`, `make mrproper`,
`make install DESTDIR=/tmp/criu`, `make uninstall DESTDIR=/tmp/criu`

Note: I improperly called v1 for this patch as "return to make from
top Makefile" -- but I didn't mean that (and it was friday ;)

This patch doesn't yet switch to top-Makefile building, but that's
a step in that way (building from a top Makefile needs correct pathes
in makefiles) which also adds ability to build objects in subdirectories
and etc.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-08-01 18:38:32 +03:00

58 lines
1.4 KiB
Makefile

#
# Installation paths.
DESTDIR ?= /
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
MANDIR ?= $(PREFIX)/share/man
SYSTEMDUNITDIR ?= $(PREFIX)/lib/systemd/system/
LOGROTATEDIR ?= $(PREFIX)/etc/logrotate.d/
LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include/criu
LIBEXECDIR ?= $(PREFIX)/libexec
#
# For recent Debian/Ubuntu with multiarch support.
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
ifneq "$(DEB_HOST_MULTIARCH)" ""
LIBDIR ?= $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
else
#
# For most other systems
ifeq "$(shell uname -m)" "x86_64"
LIBDIR ?= $(PREFIX)/lib64
endif
endif
export BINDIR SBINDIR MANDIR SYSTEMDUNITDIR LOGROTATEDIR
export INCLUDEDIR LIBDIR DESTDIR PREFIX LIBEXECDIR
install-tree:
$(Q) mkdir -p $(DESTDIR)$(SYSTEMDUNITDIR)
$(Q) mkdir -p $(DESTDIR)$(LOGROTATEDIR)
$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)
$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)
.PHONY: install-tree
install-man:
$(Q) $(MAKE) -C Documentation install
.PHONY: install-man
install-lib: lib
$(Q) $(MAKE) -C lib install
.PHONY: install-lib
install-criu: criu
$(Q) $(MAKE) $(build)=criu install
.PHONY: install-criu
install: install-man install-lib install-criu
@true
.PHONY: install
uninstall:
$(Q) $(MAKE) -C Documentation $@
$(Q) $(MAKE) -C lib $@
$(Q) $(MAKE) -C criu $@
.PHONY: uninstall