X-Git-Url: https://rtime.felk.cvut.cz/gitweb/jailhouse.git/blobdiff_plain/553a586809fb877df57680b4540cc707e521a0ac..HEAD:/Makefile diff --git a/Makefile b/Makefile index f312598..6d597af 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,12 @@ # the COPYING file in the top-level directory. # +# 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 + # no recipes above this one (also no includes) all: modules tools @@ -22,31 +28,44 @@ KDIR ?= /lib/modules/`uname -r`/build INSTALL_MOD_PATH ?= $(DESTDIR) export INSTALL_MOD_PATH -define run-kbuild = - +$(Q)$(MAKE) -C $(KDIR) M=$$PWD $@ -endef +DOXYGEN ?= doxygen -modules: - $(run-kbuild) +kbuild = -C $(KDIR) M=$$PWD $@ -hypervisor/jailhouse.bin: modules +modules: + $(Q)$(MAKE) $(kbuild) # recursive build of tools tools: $(Q)$(MAKE) -C tools -# clean up kernel and tools -clean: - $(run-kbuild) +# 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 - $(run-kbuild) + $(Q)$(MAKE) $(kbuild) + +firmware_install: $(DESTDIR)$(firmwaredir) modules + $(INSTALL_DATA) hypervisor/jailhouse*.bin $< -firmware_install: hypervisor/jailhouse.bin $(DESTDIR)$(firmwaredir) - $(INSTALL_DATA) $^ +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 +install: modules_install firmware_install $(TOOL_INMATES_INSTALL) $(Q)$(MAKE) -C tools $@ -.PHONY: modules_install install clean firmware_install modules tools +.PHONY: modules_install install clean firmware_install modules tools docs \ + docs_clean