-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (50 loc) · 1.61 KB
/
Makefile
File metadata and controls
62 lines (50 loc) · 1.61 KB
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
# Copyright (C) 2023 Gramine contributors
# SPDX-License-Identifier: BSD-3-Clause
ARCH_LIBDIR ?= /lib/$(shell $(CC) -dumpmachine)
SELF_EXE = tee-bootstrap-ens
.PHONY: all
all: $(SELF_EXE) tee-bootstrap-ens.manifest
ifeq ($(SGX),1)
all: tee-bootstrap-ens.manifest.sgx tee-bootstrap-ens.sig
endif
ifeq ($(DEBUG),1)
GRAMINE_LOG_LEVEL = debug
else
GRAMINE_LOG_LEVEL = error
endif
# Note that we're compiling in release mode regardless of the DEBUG setting passed
# to Make, as compiling in debug mode results in an order of magnitude's difference in
# performance that makes testing by running a benchmark with ab painful. The primary goal
# of the DEBUG setting is to control Gramine's loglevel.
-include $(SELF_EXE).d # See also: .cargo/config.toml
$(SELF_EXE): main.go
go build -o tee-bootstrap-ens main.go
tee-bootstrap-ens.manifest: tee-bootstrap-ens.manifest.template
gramine-manifest \
-Dlog_level=$(GRAMINE_LOG_LEVEL) \
-Darch_libdir=$(ARCH_LIBDIR) \
-Dself_exe=$(SELF_EXE) \
$< $@
# Make on Ubuntu <= 20.04 doesn't support "Rules with Grouped Targets" (`&:`),
# see the helloworld example for details on this workaround.
tee-bootstrap-ens.manifest.sgx tee-bootstrap-ens.sig: sgx_sign
@:
.INTERMEDIATE: sgx_sign
sgx_sign: tee-bootstrap-ens.manifest $(SELF_EXE)
gramine-sgx-sign \
--manifest $< \
--output $<.sgx
ifeq ($(SGX),)
GRAMINE = gramine-direct
else
GRAMINE = gramine-sgx
endif
.PHONY: start-gramine-server
start-gramine-server: all
$(GRAMINE) tee-bootstrap-ens
.PHONY: clean
clean:
$(RM) -rf *.token *.sig *.manifest.sgx *.manifest result-* OUTPUT
.PHONY: distclean
distclean: clean
$(RM) -rf {SELF_EXE}