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@kernel.org>
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
./$(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