-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
85 lines (72 loc) · 2.02 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
#
# Makefile
#
# Copyright (c) 2020 Cisco Systems, Inc. <pmoore2@cisco.com>
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
include make.conf
SUBDIRS = \
libefihelpers \
keys \
utils
.PHONY: all
all: help
.PHONY: help
help:
@echo "build system"
@echo " make targets:"
@echo " help: display a list of make targets [DEFAULT]"
@echo " build: build the binaries, keys, etc."
@echo " qemu-esp: start QEMU with just the ESP drive"
@echo " qemu-full: start QEMU with the ESP and OS drives"
@echo " clean: remove all build artifacts"
@echo " clean-keys: remove all of the UEFI keys/certs"
.PHONY: build
build:
for i in ${SUBDIRS}; do \
${MAKE} -C $$i $@; \
done
.PHONY: version.raw
version.raw: build
echo "#define VERSION_STR " \
"L\"$$(date '+%Y-%m-%d') $$(git rev-parse HEAD | cut -c 1-12)" \
"$$(cat ${FS_ESP_DEPS} | sha1sum | cut -c 1-12)"\" \
> version.raw
version.txt: version.raw
diff -q version.raw $@ || cp version.raw $@
ovmf_fw.fd:
cp ${OVMF_CODE} $@
ovmf_vars.fd:
cp ${OVMF_VARS} $@
.PHONY: qemu-esp
qemu-esp: ovmf_fw.fd ovmf_vars.fd
./tools/run-sw-tpm
${QEMU_CMD_CORE}
.PHONY: qemu-full
qemu-full: ovmf_fw.fd ovmf_vars.fd
./tools/run-sw-tpm
echo ready
${QEMU_CMD_CORE} \
-drive if=virtio,format=raw,cache=none,file=drive_qemu.img \
-drive file=distro.iso,media=cdrom
.PHONY: clean
clean:
${RM} -f version.txt
for i in ${SUBDIRS}; do \
${MAKE} -C $$i $@; \
done
.PHONY: clean-keys
clean-keys:
${MAKE} -C keys clean-keys