Commit e516aa01 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

Makefiles: add install target

Note to package maintainers:

1 Yes we do support DESTDIR.

2 From packaging scripts, use something like this:

	make install DESTDIR=$RPM_BUILD_ROOT PREFIX=/usr

(v2: add PREFIX, install to /usr/local not /usr by default)
(v3: fix criu man section -- it is 8 not 1)
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ab433857
......@@ -6,6 +6,7 @@ XMLTO := xmlto
SRC += criu.txt
MANS := $(patsubst %.txt,%.8,$(SRC))
MAN8DIR := $(MANDIR)/man8
all: $(MANS)
......@@ -19,4 +20,9 @@ clean:
$(Q) rm -f ./*.xml
$(Q) rm -f ./*.1
.PHONY: clean
install: $(MANS)
$(E) " INSTALL " $(MANS)
$(Q) mkdir -p $(DESTDIR)$(MAN8DIR)
$(Q) install $(MANS) $(DESTDIR)$(MAN8DIR)
.PHONY: clean install
......@@ -201,12 +201,23 @@ criu-$(CRTOOLSVERSION).tar.bz2:
v$(CRTOOLSVERSION) | bzip2 > $@
.PHONY: dist tar
install: $(PROGRAM) install-man
$(E) " INSTALL " $(PROGRAM)
$(Q) mkdir -p $(DESTDIR)$(SBINDIR)
$(Q) install -m 755 $(PROGRAM) $(DESTDIR)$(SBINDIR)
install-man:
$(Q) $(MAKE) -C Documentation install
.PHONY: install install-man
help:
@echo ' Targets:'
@echo ' all - Build all [*] targets'
@echo ' * criu - Build criu'
@echo ' zdtm - Build zdtm test-suite'
@echo ' docs - Build documentation'
@echo ' install - Install binary and man page'
@echo ' clean - Clean everything'
@echo ' tags - Generate tags file (ctags)'
@echo ' cscope - Generate cscope database'
......
......@@ -9,3 +9,8 @@ else
endif
export E Q
# Installation paths
PREFIX := /usr/local
SBINDIR := $(PREFIX)/sbin
MANDIR := $(PREFIX)/share/man
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment