2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# \brief Download, and unpack the NOVA hypervisor.
|
|
|
|
# \author Stefan Kalkowski
|
2012-06-06 08:19:48 +00:00
|
|
|
# \author Alexander Boettcher
|
|
|
|
# \date 2012-06-04
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
VERBOSE ?= @
|
2012-06-06 08:19:48 +00:00
|
|
|
ECHO = @echo
|
2012-11-28 08:54:44 +00:00
|
|
|
GIT_URL = https://github.com/alex-ab/NOVA.git
|
|
|
|
GIT_REV = HEAD
|
2014-01-09 13:05:53 +00:00
|
|
|
GIT_BRANCH = r4
|
2012-06-06 08:19:48 +00:00
|
|
|
CONTRIB_DIR = contrib
|
2012-07-25 11:55:18 +00:00
|
|
|
PATCHES = $(shell find patches -name '*.patch')
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2012-05-25 10:13:05 +00:00
|
|
|
#
|
|
|
|
# Utility to check if a tool is installed
|
|
|
|
#
|
|
|
|
check_tool = $(if $(shell which $(1)),,$(error Need to have '$(1)' installed.))
|
|
|
|
|
2012-06-06 08:19:48 +00:00
|
|
|
$(call check_tool,git)
|
2012-05-25 10:13:05 +00:00
|
|
|
$(call check_tool,patch)
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# Print help information by default
|
|
|
|
#
|
2012-06-06 08:19:48 +00:00
|
|
|
help::
|
|
|
|
|
|
|
|
prepare: $(CONTRIB_DIR)
|
|
|
|
|
|
|
|
help::
|
2011-12-22 15:19:25 +00:00
|
|
|
$(ECHO)
|
|
|
|
$(ECHO) "Prepare the NOVA base repository"
|
|
|
|
$(ECHO)
|
|
|
|
$(ECHO) "--- available commands ---"
|
2012-06-06 08:19:48 +00:00
|
|
|
$(ECHO) "prepare - checkout upstream source codes"
|
|
|
|
$(ECHO) "clean - remove upstream source codes"
|
2011-12-22 15:19:25 +00:00
|
|
|
$(ECHO)
|
|
|
|
|
2012-06-06 08:19:48 +00:00
|
|
|
$(CONTRIB_DIR)/.git:
|
|
|
|
$(VERBOSE)git clone $(GIT_URL) $(CONTRIB_DIR)
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2013-02-25 10:18:51 +00:00
|
|
|
.PHONY: $(CONTRIB_DIR)
|
|
|
|
|
2012-06-06 08:19:48 +00:00
|
|
|
$(CONTRIB_DIR): $(CONTRIB_DIR)/.git
|
2013-02-25 10:18:51 +00:00
|
|
|
$(VERBOSE)cd $(CONTRIB_DIR); git pull
|
2012-11-28 08:54:44 +00:00
|
|
|
$(VERBOSE)cd $(CONTRIB_DIR); git reset --hard $(GIT_REV); git checkout $(GIT_BRANCH)
|
2012-06-06 08:19:48 +00:00
|
|
|
$(ECHO) "applying patches to '$(CONTRIB_DIR)/'"
|
|
|
|
$(VERBOSE)for i in $(PATCHES); do patch -d $@ -p1 < $$i; done
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2012-06-06 08:19:48 +00:00
|
|
|
.PHONY: $(CONTRIB_DIR)
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2012-06-06 08:19:48 +00:00
|
|
|
clean::
|
2011-12-22 15:19:25 +00:00
|
|
|
$(VERBOSE)rm -rf $(CONTRIB_DIR)
|