-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
141 lines (106 loc) · 3.58 KB
/
Makefile.am
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
## This must come first when building an application that uses Intel
## SGX enclaves.
include $(top_srcdir)/build-aux/sgx_app.am
## It sets the following automake variables:
##
## AM_CPPFLAGS = -I$(SGXSDK_INCDIR)
## AM_LDFLAGS = -L$(SGXSDK_LIBDIR)
##
## And a pattern rule for building proxy functions from EDL files:
##
## %_u.h %_u.c: %.edl
##
## And sets these Makefile variables:
##
## SGXSDK
## SGXSDK_BINDIR
## SGXSDK_INCDIR
## SGXSDK_LIBDIR
## SGXSSL
## SGXSSL_BINDIR
## SGXSSL_INCDIR
## SGXSSL_LIBDIR
## SGX_URTS_LIB
## SGX_UAE_SERVICE_LIB
## SGX_EDGER8R
SUBDIRS = Enclave
## Supply additional flags to edger8r here.
##
## SGX_EDGER8R_FLAGS=
## Needed to make our pattern rule work
Enclave.edl: Enclave/Enclave.edl
ln -s $?
Enclave.signed.so: Enclave/Enclave.signed.so
ln -s $?
Enclave/Enclave.signed.so:
make -C Enclave
## Additional automake variables
##
## AM_CPPFLAGS +=
## AM_CFLAGS =
AM_CXXFLAGS = -std=c++11
AM_CPPFLAGS += -fno-builtin-memset @OPENSSL_CPPFLAGS@
# IWATA
DEFAULT_INCLUDES = -I.@am__isrc@ -Isample_libcrypto -I$(SGXSDK)/include
## Additional targets to remove with 'make clean'. You must list
## any edger8r generated files here.
CLEANFILES = Enclave_u.c Enclave_u.h Enclave.edl Enclave.signed.so \
policy enclave_sigstruct_raw
## The build target
# server: sp
# bin_PROGRAMS = client sp mrsigner
bin_PROGRAMS = client SGXserver mrsigner
## You can't use $(wildcard ...) with automake so all source files
## have to be explicitly listed.
common = byteorder.c common.cpp crypto.c hexutil.c fileio.c base64.c \
msgio.cpp logfile.c
## client
# IWATA
# client_SOURCES = client.cpp sgx_detect_linux.c sgx_stub.c quote_size.c \
# $(common)
SGXserver_SOURCES = SGXserver.cpp sgx_detect_linux.c sgx_stub.c quote_size.c \
$(common) RA_SGXserver.cpp SGX_Fileio.cpp SGX_Measurement.cpp SGX_Print.cpp
nodist_SGXserver_SOURCES = Enclave_u.c Enclave_u.h
EXTRA_SGXserver_DEPENDENCIES = Enclave.signed.so
BUILT_SOURCES = Enclave_u.c Enclave_u.h
SGXserver_LDFLAGS= $(AM_LDFLAGS) @OPENSSL_LDFLAGS@
## sp
# IWATA
# sp_SOURCES = sp.cpp agent_wget.cpp iasrequest.cpp enclave_verify.c $(common)
client_SOURCES = client.cpp agent_wget.cpp iasrequest.cpp enclave_verify.c $(common) \
RA_client.cpp
BUILT_SOURCES += policy
EXTRA_client_DEPENDENCIES = Enclave.signed.so
if AGENT_CURL
# sp_SOURCES += agent_curl.cpp
client_SOURCES += agent_curl.cpp
endif
## mrsigner (helper app)
mrsigner_SOURCES = mrsigner.cpp crypto.c hexutil.c
## Extract the enclave SIGSTRUCT and use it to calculate MRSIGNER
policy: mrsigner policy.in Enclave.signed.so
$(SGX_SIGN) dump -cssfile enclave_sigstruct_raw -dumpfile /dev/null -enclave Enclave.signed.so
sed -e "s^@MRSIGNER@^`./mrsigner.sh enclave_sigstruct_raw`^" policy.in > policy
rm -f enclave_sigstruct_raw
client_LDFLAGS= $(AM_LDFLAGS) @OPENSSL_LDFLAGS@ @CURL_LDFLAGS@
mrsigner_LDFLAGS= $(AM_LDFLAGS) @OPENSSL_LDFLAGS@
## Library flags. At minimum, an Intel SGX application will need:
##
## -l$(SGX_URTS_LIB)
##
## Applications that use platform services or perform attestation
## will also need:
##
## -l$(SGX_UAE_SERVICE_LIB)
##
## Use the variables, not the actual library names to ensure these
## targets work on simulation builds.
# IWATA
# client_LDADD=-l$(SGX_URTS_LIB) -lsgx_ukey_exchange -l$(SGX_UAE_SERVICE_LIB) \
# -lcrypto -l:libsgx_capable.a -lpthread -ldl
SGXserver_LDADD=-l$(SGX_URTS_LIB) -lsgx_ukey_exchange -l$(SGX_UAE_SERVICE_LIB) \
-lcrypto -l:libsgx_capable.a -lpthread -ldl -lsqlite3
mrsigner_LDADD=-lcrypto
# IWATA
# sp_LDADD=-lcrypto @CURL_LIBS@
client_LDADD=-lcrypto @CURL_LIBS@ -lsample_libcrypto -Lsample_libcrypto