diff --git a/Documentation/Makefile b/Documentation/Makefile index 011439345..132be6bf0 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -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 diff --git a/Makefile b/Makefile index c459ce5b8..cbe5a9732 100644 --- a/Makefile +++ b/Makefile @@ -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' diff --git a/Makefile.inc b/Makefile.inc index f11cdcccd..23b4d9e97 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -9,3 +9,8 @@ else endif export E Q + +# Installation paths +PREFIX := /usr/local +SBINDIR := $(PREFIX)/sbin +MANDIR := $(PREFIX)/share/man