2018-05-15 09:09:20 +08:00
|
|
|
|
|
|
|
# global helper variables
|
|
|
|
T := $(CURDIR)
|
2018-12-11 16:00:56 +08:00
|
|
|
|
2019-03-15 12:02:28 +08:00
|
|
|
BOARD ?= apl-nuc
|
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
|
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-07-29 12:21:54 +08:00
|
|
|
EFI_OUT := $(ROOT_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 ?=
|
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
|
|
|
|
|
|
|
hypervisor:
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) clean
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE)
|
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-07-29 12:21:54 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(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
|
|
|
sbl-hypervisor:
|
2019-02-25 10:12:45 +08:00
|
|
|
@mkdir -p $(HV_OUT)-sbl/apl-mrb $(HV_OUT)-sbl/apl-up2
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-mrb BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE) clean
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-mrb BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE)
|
2019-02-25 10:12:45 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE) clean
|
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE)
|
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
|
|
|
|
2018-05-17 03:21:45 +08:00
|
|
|
hypervisor-install:
|
2018-12-18 13:42:53 +08:00
|
|
|
ifeq ($(FIRMWARE),sbl)
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install
|
2018-12-10 19:32:42 +08:00
|
|
|
endif
|
2018-12-18 13:42:53 +08:00
|
|
|
ifeq ($(FIRMWARE),uefi)
|
2019-07-28 20:28:56 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install
|
2019-07-29 12:21:54 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install
|
2018-12-10 19:32:42 +08:00
|
|
|
endif
|
2018-05-17 03:21:45 +08:00
|
|
|
|
2019-01-22 11:12:53 +08:00
|
|
|
hypervisor-install-debug:
|
|
|
|
ifeq ($(FIRMWARE),sbl)
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install-debug
|
2019-01-22 11:12:53 +08:00
|
|
|
endif
|
|
|
|
ifeq ($(FIRMWARE),uefi)
|
2019-07-29 12:21:54 +08:00
|
|
|
$(MAKE) -C $(T)/misc/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install-debug
|
2019-01-22 11:12:53 +08:00
|
|
|
endif
|
|
|
|
|
2018-05-24 17:39:59 +08:00
|
|
|
sbl-hypervisor-install:
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-mrb BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE) install
|
2019-02-25 10:12:45 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE) install
|
2018-05-24 17:39:59 +08:00
|
|
|
|
2019-01-22 11:12:53 +08:00
|
|
|
sbl-hypervisor-install-debug:
|
2019-01-17 05:35:20 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-mrb BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE) install-debug
|
2019-02-25 10:12:45 +08:00
|
|
|
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE) 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
|