[CRIU] [PATCH 4/4] Makefiles: add install target

Kir Kolyshkin kir at openvz.org
Tue Apr 30 16:25:09 EDT 2013


Note to package maintainers: yes we do support DESTDIR ;)

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 Documentation/Makefile | 11 ++++++++++-
 Makefile               | 13 +++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index d856e18..76691e4 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -7,6 +7,10 @@ XMLTO		:= xmlto
 SRC		+= crtools.txt
 MANS		:= $(patsubst %.txt,%.1,$(SRC))
 
+# Installation paths
+MANDIR		:= /usr/share/man
+MAN1DIR		:= $(MANDIR)/man1
+
 all: $(MANS)
 
 %.1: %.txt
@@ -19,4 +23,9 @@ clean:
 	$(Q) rm -f ./*.xml
 	$(Q) rm -f ./*.1
 
-.PHONY: clean
+install: $(MANS)
+	$(E) "  INSTALL " $(MANS)
+	$(Q) mkdir -p $(DESTDIR)$(MAN1DIR)
+	$(Q) install $(MANS) $(DESTDIR)$(MAN1DIR)
+
+.PHONY: clean install
diff --git a/Makefile b/Makefile
index 5cc5fb7..29bf1c0 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,9 @@ SH		:= bash
 MAKE		:= make
 OBJCOPY		:= objcopy
 
+# Installation paths
+SBINDIR		:= /usr/sbin
+
 #
 # Fetch ARCH from the uname if not yet set
 #
@@ -203,6 +206,16 @@ 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:
 	$(E) '    Targets:'
 	$(E) '      all             - Build all [*] targets'
-- 
1.8.1.4



More information about the CRIU mailing list