[tip:tools/kvm] kvm tools: Add 'install' target to Makefile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  3c8ef41661c84bc8c96ae120b65fc0a8f4f8029f
Gitweb:     http://git.kernel.org/tip/3c8ef41661c84bc8c96ae120b65fc0a8f4f8029f
Author:     Pekka Enberg <penberg@xxxxxxxxxx>
AuthorDate: Fri, 17 Aug 2012 10:51:05 +0300
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Fri, 17 Aug 2012 10:51:05 +0300

kvm tools: Add 'install' target to Makefile

Add a new 'install' target to Makefile that installs 'lkvm' binary to
$HOME/bin by default. The installed binary still needs to be launched
from linux/tools/kvm directory because of our silly external dependency
to stage 2 guest init file:

  [penberg@tux ~]$ lkvm run
    Fatal: Failed linking stage 2 of init.

The most convinent way to fix that is to embed the stage 2 image in
'lkvm' executable like we do with our mini-BIOS.

Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/Makefile |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
index f9e1ec1..924b191 100644
--- a/tools/kvm/Makefile
+++ b/tools/kvm/Makefile
@@ -24,6 +24,14 @@ CC	:= $(CROSS_COMPILE)$(CC)
 FIND	:= find
 CSCOPE	:= cscope
 TAGS	:= ctags
+INSTALL := install
+
+prefix = $(HOME)
+bindir_relative = bin
+bindir = $(prefix)/$(bindir_relative)
+
+DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
+bindir_SQ = $(subst ','\'',$(bindir))
 
 PROGRAM	:= lkvm
 PROGRAM_ALIAS := vm
@@ -380,6 +388,12 @@ check: all
 	./$(PROGRAM) run -d tests/boot/boot_test.iso -p "init=init"
 .PHONY: check
 
+install: all
+	$(E) "  INSTALL"
+	$(Q) $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' 
+	$(Q) $(INSTALL) $(PROGRAM) '$(DESTDIR_SQ)$(bindir_SQ)' 
+.PHONY: install
+
 clean:
 	$(E) "  CLEAN"
 	$(Q) rm -f x86/bios/*.bin
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux