/
Makefile
38 lines (31 loc) · 1.03 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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Detect C and C++ compiler options
# if not gcc and g++, default to clang-7
C_COMPILER=$(notdir $(CC))
ifeq ($(C_COMPILER), gcc)
CXX_COMPILER=$(notdir $(CXX))
USE_GCC = true
endif
ifeq ($(USE_GCC),)
CC = clang-7
CXX = clang++-7
C_COMPILER=clang
CXX_COMPILER=clang++
endif
CFLAGS=$(shell pkg-config oeenclave-$(C_COMPILER) --cflags)
CXXFLAGS=$(shell pkg-config oeenclave-$(CXX_COMPILER) --cflags)
LDFLAGS=$(shell pkg-config oeenclave-$(CXX_COMPILER) --libs)
all:
$(MAKE) build
$(MAKE) sign
build:
cp ../enc1/private.pem .
@ echo "Compilers used: $(CC), $(CXX)"
$(CXX) -c $(CXXFLAGS) $(INCLUDES) -std=c++11 ecalls.cpp ../common/dispatcher.cpp ../common/keys.cpp
$(CC) -c $(CFLAGS) $(CINCLUDES) ../common/datasealing_t.c
$(CXX) -o enclave_a_v2.so ecalls.o dispatcher.o keys.o datasealing_t.o $(LDFLAGS)
sign:
oesign sign enclave_a_v2.so data-sealing.conf private.pem
clean:
rm -f *.so *.o *.pem