From: Pekka Enberg Date: Fri, 17 Aug 2012 07:51:05 +0000 (+0300) Subject: kvm tools: Add 'install' target to Makefile X-Git-Tag: next-20120820~5^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3c8ef41661c84bc8c96ae120b65fc0a8f4f8029f;p=karo-tx-linux.git 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 --- diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index f9e1ec192640..924b1912b6b4 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