X-Git-Url: https://rtime.felk.cvut.cz/gitweb/jailhouse.git/blobdiff_plain/c690fb976081ac4b1f7f57fc2b64a757f963723b..HEAD:/Makefile diff --git a/Makefile b/Makefile index b693c93..6d597af 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # # Jailhouse, a Linux-based partitioning hypervisor # -# Copyright (c) Siemens AG, 2013 +# Copyright (c) Siemens AG, 2013, 2014 # # Authors: # Jan Kiszka @@ -10,23 +10,62 @@ # the COPYING file in the top-level directory. # -subdir-y := hypervisor config inmate +# Check make version +need := 3.82 +ifneq ($(need),$(firstword $(sort $(MAKE_VERSION) $(need)))) +$(error Too old make version $(MAKE_VERSION), at least $(need) required) +endif -obj-m := jailhouse.o +# no recipes above this one (also no includes) +all: modules tools -ccflags-y := -I$(src)/hypervisor/arch/$(SRCARCH)/include \ - -I$(src)/hypervisor/include +# includes installation-related variables and definitions +include scripts/include.mk -jailhouse-y := main.o +# out-of-tree build for our kernel-module, firmware and inmates +KDIR ?= /lib/modules/`uname -r`/build -# out-of-tree build +INSTALL_MOD_PATH ?= $(DESTDIR) +export INSTALL_MOD_PATH -KERNELDIR = /lib/modules/`uname -r`/build +DOXYGEN ?= doxygen -modules modules_install clean: - $(MAKE) -C $(KERNELDIR) SUBDIRS=`pwd` $@ +kbuild = -C $(KDIR) M=$$PWD $@ -install: modules_install - depmod -aq +modules: + $(Q)$(MAKE) $(kbuild) -.PHONY: modules_install install clean +# recursive build of tools +tools: + $(Q)$(MAKE) -C tools + +# documentation, build needs to be triggered explicitly +docs: + $(DOXYGEN) Documentation/Doxyfile + +# remove generated docs +docs_clean: + rm -rf Documentation/generated + +# clean up kernel, tools and generated docs +clean: docs_clean + $(Q)$(MAKE) $(kbuild) + $(Q)$(MAKE) -C tools $@ + +modules_install: modules + $(Q)$(MAKE) $(kbuild) + +firmware_install: $(DESTDIR)$(firmwaredir) modules + $(INSTALL_DATA) hypervisor/jailhouse*.bin $< + +ifeq ($(ARCH),x86) +TOOL_INMATES_INSTALL := tool_inmates_install +tool_inmates_install: $(DESTDIR)$(libexecdir)/jailhouse + $(INSTALL_DATA) inmates/tools/$(ARCH)/*.bin $< +endif + +install: modules_install firmware_install $(TOOL_INMATES_INSTALL) + $(Q)$(MAKE) -C tools $@ + +.PHONY: modules_install install clean firmware_install modules tools docs \ + docs_clean