forked from openenclave/openenclave
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
40 lines (31 loc) · 1.04 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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Detect C and C++ compiler options
# if not gcc, default to clang-7
COMPILER=$(notdir $(CC))
ifeq ($(COMPILER), gcc)
USE_GCC = true
endif
ifeq ($(USE_GCC),)
CC = clang-7
COMPILER=clang
endif
CFLAGS=$(shell pkg-config oeenclave-$(COMPILER) --cflags)
LDFLAGS=$(shell pkg-config oeenclave-$(COMPILER) --libs)
all:
$(MAKE) build
$(MAKE) keys
$(MAKE) sign
build:
@ echo "Compilers used: $(CC), $(CXX)"
oeedger8r ../helloworld.edl --trusted
$(CC) -g -c $(CFLAGS) -DOE_API_VERSION=2 enc.c -o enc.o
$(CC) -g -c $(CFLAGS) -DOE_API_VERSION=2 helloworld_t.c -o helloworld_t.o
$(CC) -o helloworldenc helloworld_t.o enc.o $(LDFLAGS)
sign:
oesign sign -e helloworldenc -c helloworld.conf -k private.pem
clean:
rm -f enc.o helloworldenc helloworldenc.signed private.pem public.pem helloworld_t.o helloworld_t.h helloworld_t.c helloworld_args.h
keys:
openssl genrsa -out private.pem -3 3072
openssl rsa -in private.pem -pubout -out public.pem