2018-05-15 09:09:20 +08:00
|
|
|
|
|
|
|
# global helper variables
|
|
|
|
T := $(CURDIR)
|
2018-12-11 16:00:56 +08:00
|
|
|
|
2019-10-30 13:35:57 +08:00
|
|
|
BOARD ?= kbl-nuc-i7
|
2018-12-11 16:00:56 +08:00
|
|
|
|
2019-08-06 19:46:31 +08:00
|
|
|
ifneq (,$(filter $(BOARD),apl-mrb))
|
|
|
|
FIRMWARE ?= sbl
|
|
|
|
else
|
|
|
|
FIRMWARE ?= uefi
|
2018-12-11 16:00:56 +08:00
|
|
|
endif
|
|
|
|
|
2018-05-17 16:44:11 +08:00
|
|
|
RELEASE ?= 0
|
2019-08-14 11:27:21 +08:00
|
|
|
SCENARIO ?= sdc
|
2018-05-15 09:09:20 +08:00
|
|
|
|
2018-05-23 19:24:29 +08:00
|
|
|
O ?= build
|
|
|
|
ROOT_OUT := $(shell mkdir -p $(O);cd $(O);pwd)
|
2018-05-15 09:09:20 +08:00
|
|
|
HV_OUT := $(ROOT_OUT)/hypervisor
|
2019-10-11 14:07:17 +08:00
|
|
|
EFI_OUT := misc/efi-stub
|
2018-05-15 09:09:20 +08:00
|
|
|
DM_OUT := $(ROOT_OUT)/devicemodel
|
2019-07-29 12:21:54 +08:00
|
|
|
TOOLS_OUT := $(ROOT_OUT)/misc/tools
|
2018-06-12 17:38:43 +08:00
|
|
|
DOC_OUT := $(ROOT_OUT)/doc
|
2018-08-06 10:09:27 +08:00
|
|
|
BUILD_VERSION ?=
|
|
|
|
BUILD_TAG ?=
|
2019-09-11 14:42:05 +08:00
|
|
|
BOARD_FILE ?=
|
|
|
|
SCENARIO_FILE ?=
|
2019-09-19 23:07:10 +08:00
|
|
|
CONFIG_XML_ENABLED ?= false
|
2019-09-11 14:42:05 +08:00
|
|
|
|
2018-05-30 02:16:56 +08:00
|
|
|
export TOOLS_OUT
|
2018-05-15 09:09:20 +08:00
|
|
|
|
2018-08-09 09:25:13 +08:00
|
|
|
.PHONY: all hypervisor devicemodel tools doc
|
|
|
|
all: hypervisor devicemodel tools
|
2018-05-15 09:09:20 +08:00
|
|
|
|
2019-09-11 14:42:05 +08:00
|
|
|
ifneq ($(BOARD_FILE)$(SCENARIO_FILE),)
|
2019-09-19 23:07:10 +08:00
|
|
|
override BOARD := $(shell echo `sed -n '/<acrn-config/p' $(BOARD_FILE) | sed -r 's/.*board="(.*)".*/\1/g'`)
|
|
|
|
override SCENARIO := $(shell echo `sed -n '/<acrn-config/p' $(SCENARIO_FILE) | sed -r 's/.*scenario="(.*)".*/\1/g'`)
|
2019-09-11 14:42:05 +08:00
|
|
|
|
2019-09-19 23:07:10 +08:00
|
|
|
ifneq ($(BOARD)$(SCENARIO),)
|
|
|
|
CONFIG_XML_ENABLED := true
|
|
|
|
endif
|
2019-09-17 11:55:47 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BOARD), apl-nuc)
|
|
|
|
override BOARD := nuc6cayh
|
|
|
|
else ifeq ($(BOARD), kbl-nuc-i7)
|
|
|
|
override BOARD := nuc7i7dnb
|
|
|
|
endif
|
|
|
|
|
2019-09-27 17:15:36 +08:00
|
|
|
#help functions to build acrn and install acrn/acrn symbols
|
|
|
|
define build_acrn
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(4) RELEASE=$(RELEASE) clean
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(4) RELEASE=$(RELEASE) defconfig
|
|
|
|
@echo "$(3)=y" >> $(HV_OUT)-$(1)/$(2)/.config
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(4) RELEASE=$(RELEASE) oldconfig
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(4) RELEASE=$(RELEASE)
|
|
|
|
echo "building hypervisor as EFI executable..."
|
2019-10-24 14:22:42 +08:00
|
|
|
@if [ "$(1)" = "uefi" ]; then \
|
2019-10-11 14:07:17 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT)-$(1)/$(2) SCENARIO=$(4) EFI_OBJDIR=$(HV_OUT)-$(1)/$(2)/$(EFI_OUT); \
|
2019-09-27 17:15:36 +08:00
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
define install_acrn
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(3) RELEASE=$(RELEASE) install
|
2019-10-24 14:22:42 +08:00
|
|
|
@if [ "$(1)" = "uefi" ]; then \
|
2019-10-11 14:07:17 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(3) RELEASE=$(RELEASE) EFI_OBJDIR=$(HV_OUT)-$(1)/$(2)/$(EFI_OUT) install; \
|
2019-09-27 17:15:36 +08:00
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
define install_acrn_debug
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(3) RELEASE=$(RELEASE) install-debug
|
2019-10-24 14:22:42 +08:00
|
|
|
@if [ "$(1)" = "uefi" ]; then \
|
2019-10-11 14:07:17 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT)-$(1)/$(2) BOARD=$(2) FIRMWARE=$(1) SCENARIO=$(3) RELEASE=$(RELEASE) EFI_OBJDIR=$(HV_OUT)-$(1)/$(2)/$(EFI_OUT) install-debug; \
|
2019-09-27 17:15:36 +08:00
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
2019-09-19 23:07:10 +08:00
|
|
|
hypervisor:
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) \
|
|
|
|
BOARD_FILE=$(BOARD_FILE) SCENARIO_FILE=$(SCENARIO_FILE) clean
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) \
|
|
|
|
BOARD_FILE=$(BOARD_FILE) SCENARIO_FILE=$(SCENARIO_FILE) defconfig
|
2019-09-17 11:55:47 +08:00
|
|
|
@if [ "$(SCENARIO)" ]; then \
|
|
|
|
echo "CONFIG_$(shell echo $(SCENARIO) | tr a-z A-Z)=y" >> $(HV_OUT)/.config; \
|
|
|
|
fi
|
2019-09-19 23:07:10 +08:00
|
|
|
@if [ "$(CONFIG_XML_ENABLED)" = "true" ]; then \
|
2019-09-17 11:55:47 +08:00
|
|
|
echo "CONFIG_ENFORCE_VALIDATED_ACPI_INFO=y" >> $(HV_OUT)/.config; \
|
|
|
|
fi
|
2019-09-19 23:07:10 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) \
|
|
|
|
BOARD_FILE=$(BOARD_FILE) SCENARIO_FILE=$(SCENARIO_FILE) oldconfig
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) \
|
|
|
|
BOARD_FILE=$(BOARD_FILE) SCENARIO_FILE=$(SCENARIO_FILE)
|
2018-12-18 13:42:53 +08:00
|
|
|
ifeq ($(FIRMWARE),uefi)
|
2018-12-10 19:32:42 +08:00
|
|
|
echo "building hypervisor as EFI executable..."
|
2019-10-11 14:07:17 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) SCENARIO=$(SCENARIO) EFI_OBJDIR=$(HV_OUT)/$(EFI_OUT)
|
2018-12-10 19:32:42 +08:00
|
|
|
endif
|
2018-05-15 09:09:20 +08:00
|
|
|
|
2018-05-24 17:39:59 +08:00
|
|
|
|
2018-05-30 02:16:56 +08:00
|
|
|
devicemodel: tools
|
2019-04-16 10:59:25 +08:00
|
|
|
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) RELEASE=$(RELEASE) clean
|
|
|
|
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) DM_ASL_COMPILER=$(ASL_COMPILER) RELEASE=$(RELEASE)
|
2018-05-15 09:09:20 +08:00
|
|
|
|
|
|
|
tools:
|
|
|
|
mkdir -p $(TOOLS_OUT)
|
2019-07-29 12:21:54 +08:00
|
|
|
$(MAKE) -C $(T)/misc OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE)
|
2018-05-15 09:09:20 +08:00
|
|
|
|
2018-06-12 17:38:43 +08:00
|
|
|
doc:
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/doc html BUILDDIR=$(DOC_OUT)
|
2018-06-12 17:38:43 +08:00
|
|
|
|
2018-05-15 09:09:20 +08:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2019-07-29 12:21:54 +08:00
|
|
|
$(MAKE) -C $(T)/misc OUT_DIR=$(TOOLS_OUT) clean
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/doc BUILDDIR=$(DOC_OUT) clean
|
2018-05-15 09:09:20 +08:00
|
|
|
rm -rf $(ROOT_OUT)
|
2018-05-18 16:38:19 +08:00
|
|
|
|
2018-05-17 03:21:45 +08:00
|
|
|
.PHONY: install
|
2018-08-09 09:25:13 +08:00
|
|
|
install: hypervisor-install devicemodel-install tools-install
|
2018-05-15 09:09:20 +08:00
|
|
|
|
2019-09-19 23:07:10 +08:00
|
|
|
hypervisor-install:
|
2019-08-14 11:27:21 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) SCENARIO=$(SCENARIO) RELEASE=$(RELEASE) install
|
2018-12-18 13:42:53 +08:00
|
|
|
ifeq ($(FIRMWARE),uefi)
|
2019-10-11 14:07:17 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) SCENARIO=$(SCENARIO) EFI_OBJDIR=$(HV_OUT)/$(EFI_OUT) all install
|
2018-12-10 19:32:42 +08:00
|
|
|
endif
|
2018-05-17 03:21:45 +08:00
|
|
|
|
2019-09-19 23:07:10 +08:00
|
|
|
hypervisor-install-debug:
|
2019-08-14 11:27:21 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) SCENARIO=$(SCENARIO) RELEASE=$(RELEASE) install-debug
|
2019-01-22 11:12:53 +08:00
|
|
|
ifeq ($(FIRMWARE),uefi)
|
2019-10-11 14:07:17 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) SCENARIO=$(SCENARIO) EFI_OBJDIR=$(HV_OUT)/$(EFI_OUT) all install-debug
|
2019-01-22 11:12:53 +08:00
|
|
|
endif
|
|
|
|
|
2019-09-27 17:15:36 +08:00
|
|
|
apl-mrb-sbl-sdc:
|
|
|
|
$(call build_acrn,sbl,apl-mrb,CONFIG_SDC,sdc)
|
|
|
|
apl-up2-sbl-sdc:
|
|
|
|
$(call build_acrn,sbl,apl-up2,CONFIG_SDC,sdc)
|
|
|
|
kbl-nuc-i7-uefi-industry:
|
2019-10-30 13:35:57 +08:00
|
|
|
$(call build_acrn,uefi,nuc7i7dnb,CONFIG_INDUSTRY,industry)
|
2019-10-08 13:29:55 +08:00
|
|
|
apl-up2-uefi-hybrid:
|
|
|
|
$(call build_acrn,uefi,apl-up2,CONFIG_HYBRID,hybrid)
|
2019-09-27 17:15:36 +08:00
|
|
|
|
2019-10-08 13:29:55 +08:00
|
|
|
sbl-hypervisor: apl-mrb-sbl-sdc \
|
|
|
|
apl-up2-sbl-sdc \
|
|
|
|
kbl-nuc-i7-uefi-industry \
|
|
|
|
apl-up2-uefi-hybrid
|
2019-09-27 17:15:36 +08:00
|
|
|
|
|
|
|
apl-mrb-sbl-sdc-install:
|
|
|
|
$(call install_acrn,sbl,apl-mrb,sdc)
|
|
|
|
apl-up2-sbl-sdc-install:
|
|
|
|
$(call install_acrn,sbl,apl-up2,sdc)
|
|
|
|
kbl-nuc-i7-uefi-industry-install:
|
2019-10-30 13:35:57 +08:00
|
|
|
$(call install_acrn,uefi,nuc7i7dnb,industry)
|
2019-10-08 13:29:55 +08:00
|
|
|
apl-up2-uefi-hybrid-install:
|
|
|
|
$(call install_acrn,uefi,apl-up2,hybrid)
|
2019-09-27 17:15:36 +08:00
|
|
|
|
2019-10-08 13:29:55 +08:00
|
|
|
sbl-hypervisor-install: apl-mrb-sbl-sdc-install \
|
|
|
|
apl-up2-sbl-sdc-install \
|
|
|
|
kbl-nuc-i7-uefi-industry-install \
|
|
|
|
apl-up2-uefi-hybrid-install
|
2019-09-27 17:15:36 +08:00
|
|
|
|
|
|
|
apl-mrb-sbl-sdc-install-debug:
|
|
|
|
$(call install_acrn_debug,sbl,apl-mrb,sdc)
|
|
|
|
apl-up2-sbl-sdc-install-debug:
|
|
|
|
$(call install_acrn_debug,sbl,apl-up2,sdc)
|
|
|
|
kbl-nuc-i7-uefi-industry-install-debug:
|
2019-10-30 13:35:57 +08:00
|
|
|
$(call install_acrn_debug,uefi,nuc7i7dnb,industry)
|
2019-10-08 13:29:55 +08:00
|
|
|
apl-up2-uefi-hybrid-install-debug:
|
|
|
|
$(call install_acrn_debug,uefi,apl-up2,hybrid)
|
2019-09-27 17:15:36 +08:00
|
|
|
|
2019-10-08 13:29:55 +08:00
|
|
|
sbl-hypervisor-install-debug: apl-mrb-sbl-sdc-install-debug \
|
|
|
|
apl-up2-sbl-sdc-install-debug \
|
|
|
|
kbl-nuc-i7-uefi-industry-install-debug \
|
|
|
|
apl-up2-uefi-hybrid-install-debug
|
2019-01-22 11:12:53 +08:00
|
|
|
|
2018-05-17 03:21:45 +08:00
|
|
|
devicemodel-install:
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) install
|
2018-05-17 03:21:45 +08:00
|
|
|
|
2018-05-17 06:59:53 +08:00
|
|
|
tools-install:
|
2019-07-29 12:21:54 +08:00
|
|
|
$(MAKE) -C $(T)/misc OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE) install
|