This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 261
/
Makefile
73 lines (58 loc) · 1.71 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
# Use one of these commands to build the manifest for sqlite:
#
# - make
# - make DEBUG=1
# - make SGX=1
# - make SGX=1 DEBUG=1
#
# Use `make clean` to remove Graphene-generated files.
# Relative path to Graphene root and key for enclave signing
GRAPHENEDIR ?= ../..
SGX_SIGNER_KEY ?= $(GRAPHENEDIR)/Pal/src/host/Linux-SGX/signer/enclave-key.pem
ifeq ($(DEBUG),1)
GRAPHENE_LOG_LEVEL = debug
else
GRAPHENE_LOG_LEVEL = error
endif
.PHONY: all
all: sqlite3.manifest
ifeq ($(SGX),1)
all: sqlite3.manifest.sgx sqlite3.sig sqlite3.token
endif
include ../../Scripts/Makefile.configs
sqlite3.manifest: manifest.template
graphene-manifest \
-Dlog_level=$(GRAPHENE_LOG_LEVEL) \
-Dexecdir=$(shell dirname $(shell which sqlite3)) \
-Darch_libdir=$(ARCH_LIBDIR) \
$< >$@
# Generating the SGX-specific manifest (*.manifest.sgx), the enclave signature,
# and the token for enclave initialization.
sqlite3.manifest.sgx: sqlite3.manifest
graphene-sgx-sign \
--key $(SGX_SIGNER_KEY) \
--manifest sqlite3.manifest \
--output $@
sqlite3.sig: sqlite3.manifest.sgx
sqlite3.token: sqlite3.sig
graphene-sgx-get-token --output sqlite3.token --sig sqlite3.sig
ifeq ($(SGX),)
GRAPHENE = graphene-direct
else
GRAPHENE = graphene-sgx
endif
.PHONY: regression
regression: all
@rm -f scripts/testdir/*
$(GRAPHENE) sqlite3 scripts/testdir/test.db < scripts/create.sql
@echo "[ Success 1/3 ]"
$(GRAPHENE) sqlite3 scripts/testdir/test.db < scripts/update.sql
@echo "[ Success 2/3 ]"
$(GRAPHENE) sqlite3 scripts/testdir/test.db < scripts/select.sql > OUTPUT
diff OUTPUT scripts/select.txt
@echo "[ Success 3/3 ]"
.PHONY: clean
clean:
$(RM) *.manifest *.manifest.sgx *.token *.sig OUTPUT scripts/testdir/*
.PHONY: distclean
distclean: clean