forked from projectacrn/acrn-hypervisor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
112 lines (91 loc) · 3.78 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# global helper variables
T := $(CURDIR)
# PLATFORM is now deprecated, just reserve for compatability
ifdef PLATFORM
$(warning PLATFORM is deprecated, pls use BOARD instead)
endif
PLATFORM ?= uefi
# Backward-compatibility for PLATFORM=(sbl|uefi)
# * PLATFORM=sbl is equivalent to BOARD=apl-mrb
# * PLATFORM=uefi is equivalent to BOARD=apl-nuc (i.e. NUC6CAYH)
ifeq ($(PLATFORM),sbl)
BOARD ?= apl-mrb
else ifeq ($(PLATFORM),uefi)
BOARD ?= apl-nuc
endif
undefine PLATFORM
ifndef BOARD
$(error BOARD must be set (apl-mrb, apl-nuc, apl-up2, dnv-cb2, kbl-nuc-i7, nuc6cayh, nuc7i7bnh)
endif
ifeq ($(BOARD),apl-nuc)
FIRMWARE ?= uefi
else ifeq ($(BOARD),nuc6cayh)
FIRMWARE ?= uefi
endif
FIRMWARE ?= sbl
RELEASE ?= 0
O ?= build
ROOT_OUT := $(shell mkdir -p $(O);cd $(O);pwd)
HV_OUT := $(ROOT_OUT)/hypervisor
EFI_OUT := $(ROOT_OUT)/efi-stub
DM_OUT := $(ROOT_OUT)/devicemodel
TOOLS_OUT := $(ROOT_OUT)/tools
DOC_OUT := $(ROOT_OUT)/doc
BUILD_VERSION ?=
BUILD_TAG ?=
export TOOLS_OUT
.PHONY: all hypervisor devicemodel tools doc
all: hypervisor devicemodel tools
hypervisor:
$(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)
ifeq ($(FIRMWARE),uefi)
echo "building hypervisor as EFI executable..."
$(MAKE) -C $(T)/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT)
endif
sbl-hypervisor:
@mkdir -p $(HV_OUT)-sbl/apl-mrb $(HV_OUT)-sbl/apl-up2
$(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)
$(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)
devicemodel: tools
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) clean
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) DM_BUILD_VERSION=$(BUILD_VERSION) DM_BUILD_TAG=$(BUILD_TAG) DM_ASL_COMPILER=$(ASL_COMPILER)
tools:
mkdir -p $(TOOLS_OUT)
$(MAKE) -C $(T)/tools OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE)
doc:
$(MAKE) -C $(T)/doc html BUILDDIR=$(DOC_OUT)
.PHONY: clean
clean:
$(MAKE) -C $(T)/tools OUT_DIR=$(TOOLS_OUT) clean
$(MAKE) -C $(T)/doc BUILDDIR=$(DOC_OUT) clean
rm -rf $(ROOT_OUT)
.PHONY: install
install: hypervisor-install devicemodel-install tools-install
hypervisor-install:
ifeq ($(FIRMWARE),sbl)
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install
endif
ifeq ($(FIRMWARE),uefi)
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE)
$(MAKE) -C $(T)/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install
endif
hypervisor-install-debug:
ifeq ($(FIRMWARE),sbl)
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT) BOARD=$(BOARD) FIRMWARE=$(FIRMWARE) RELEASE=$(RELEASE) install-debug
endif
ifeq ($(FIRMWARE),uefi)
$(MAKE) -C $(T)/efi-stub HV_OBJDIR=$(HV_OUT) EFI_OBJDIR=$(EFI_OUT) all install-debug
endif
sbl-hypervisor-install:
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-mrb BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE) install
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE) install
sbl-hypervisor-install-debug:
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-mrb BOARD=apl-mrb FIRMWARE=sbl RELEASE=$(RELEASE) install-debug
$(MAKE) -C $(T)/hypervisor HV_OBJDIR=$(HV_OUT)-sbl/apl-up2 BOARD=apl-up2 FIRMWARE=sbl RELEASE=$(RELEASE) install-debug
devicemodel-install:
$(MAKE) -C $(T)/devicemodel DM_OBJDIR=$(DM_OUT) install
tools-install:
$(MAKE) -C $(T)/tools OUT_DIR=$(TOOLS_OUT) RELEASE=$(RELEASE) install