forked from keystone-enclave/keystone-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.deprecated
85 lines (60 loc) · 2.54 KB
/
Makefile.deprecated
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
ifndef KEYSTONE_DIR
$(error KEYSTONE_DIR is not set)
endif
ifndef KEYSTONE_SDK_DIR
export KEYSTONE_SDK_DIR = $(KEYSTONE_DIR)/sdk
endif
ifndef LIBSODIUM_CLIENT_DIR
$(error LIBSODIUM_CLIENT_DIR is not set)
endif
CC = riscv64-unknown-linux-gnu-g++
SDK_LIB_DIR = $(KEYSTONE_SDK_DIR)/lib
SDK_HOST_LIB = $(SDK_LIB_DIR)/libkeystone-host.a
SDK_EDGE_LIB = $(SDK_LIB_DIR)/libkeystone-edge.a
SDK_VERIFIER_LIB = $(SDK_LIB_DIR)/libkeystone-verifier.a
SDK_INCLUDE_HOST_DIR = $(SDK_LIB_DIR)/host/include
SDK_INCLUDE_EDGE_DIR = $(SDK_LIB_DIR)/edge/include
SDK_INCLUDE_VERIFIER_DIR = $(SDK_LIB_DIR)/verifier
SODC_INCLUDE_DIR = $(LIBSODIUM_CLIENT_DIR)/include
SODC_LIB_DIR = $(LIBSODIUM_CLIENT_DIR)/.libs
SODC_LIB = $(SODC_LIB_DIR)/libsodium.a
SOD_LIB_DIR = $(LIBSODIUM_DIR)/.libs
SOD_LIB = $(SOD_LIB_DIR)/libsodium.a
TCLIENT_SRCS = trusted_client/client.cpp trusted_client/trusted_client.cpp include/enclave_expected_hash.h include/sm_expected_hash.h
TCLIENT = trusted_client.riscv
RUNTIME = eyrie-rt
EHOST= enclave-host.riscv
SERVER = server_eapp/server_eapp.eapp_riscv
CCFLAGS = -I$(SDK_INCLUDE_HOST_DIR) -I$(SDK_INCLUDE_EDGE_DIR) -I$(SDK_INCLUDE_VERIFIER_DIR) -Iinclude/ -I$(SODC_INCLUDE_DIR)
LDFLAGS = -L$(SDK_LIB_DIR) -L$(SODC_LIB_DIR)
SRCS = $(patsubst %.riscv, %.cpp, $(EHOST))
OBJS = $(patsubst %.riscv, %.o,$(EHOST)) $(KEYSTONE_OBJ) edge_wrapper.o
all: $(EHOST) $(TCLIENT) $(SERVER) $(RUNTIME)
$(EHOST): $(OBJS) $(SDK_HOST_LIB) $(SDK_EDGE_LIB) $(SDK_VERIFIER_LIB) $(SODC_LIB)
$(CC) $(CCFLAGS) $(LDFLAGS) -o $(EHOST) $^
.PHONY:
$(SERVER):
$(MAKE) -C `dirname $(SERVER)`
$(TCLIENT): $(TCLIENT_SRCS)
$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $^ $(SDK_VERIFIER_LIB) $(SODC_LIB)
$(RUNTIME):
$(KEYSTONE_SDK_DIR)/rts/eyrie/build.sh
cp $(KEYSTONE_SDK_DIR)/rts/eyrie/eyrie-rt .
%.a:
make -C $(SDK_LIB_DIR)
$(OBJS): %.o: %.cpp
$(CC) $(CCFLAGS) -c $<
build-hash-using-qemu: all copybins getandsethash
getandsethash:
./scripts/get_attestation.sh ./include
copybins:
mkdir -p $(KEYSTONE_DIR)/buildroot_overlay/root/keystone-demo/
cp $(TCLIENT) $(EHOST) $(SERVER) $(RUNTIME) $(KEYSTONE_DIR)/buildroot_overlay/root/keystone-demo/
@echo "Binaries copied to buildroot overlay in Keystone.\n******************************************************************************************\nRun \"make image\" in your keystone build directory to include demo binaries in image build.\n******************************************************************************************\n"
clean:
rm -f *.o *.riscv
rm -f eyrie-rt
$(foreach app, $(APPS), \
$(MAKE) -C $(app) clean; \
)
.PHONY: getandsethash clean