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

Kir Kolyshkin kir at openvz.org
Thu May 2 06:15:13 EDT 2013


Please don't apply this one yet, I will resend.
As pointed out by vvs@ (off the list), we need to install to /usr/local 
by default.

On 04/30/2013 01:25 PM, Kir Kolyshkin wrote:
> 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'



More information about the CRIU mailing list