-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (43 loc) · 1.37 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
GOARCH = amd64
UNAME = $(shell uname -s)
ifndef OS
ifeq ($(UNAME), Linux)
OS = linux
else ifeq ($(UNAME), Darwin)
OS = darwin
endif
endif
.DEFAULT_GOAL := all
GOBUILD := CGO_ENABLED=0 GOOS=$(OS) GOARCH="$(GOARCH)" go build
all: fmt build
enable:
./client.sh enable
create:
./client.sh create
build:
$(GOBUILD) -o vault/plugins/vault-plugin-auth-sgx cmd/vault-plugin-auth-sgx/main.go
strip vault/plugins/vault-plugin-auth-sgx
upx -1 vault/plugins/vault-plugin-auth-sgx
client:
$(GOBUILD) -o ./client cmd/client/main.go
premain: premain-app premain-vault
premain-app:
$(GOBUILD) -buildmode=pie -o ./premain cmd/premain-app/main.go
premain-vault:
$(GOBUILD) -o ./vault/premain-vault cmd/premain-vault/main.go
start:
mkdir -p certs
vault server -dev -dev-tls -dev-tls-cert-dir=certs -dev-listen-address=0.0.0.0:8200 -dev-root-token-id=root -dev-plugin-dir=./vault/plugins
vault: build client premain-vault
docker build -t enclaive/hashicorp-vault-sgx:k8s --progress=plain vault/
pccs:
docker build -t enclaive/sgx-pccs:latest --progress=plain pccs/
docker/%: premain-app
cp ./premain ./apps/$*/
docker build -t enclaive/$*-sgx:k8s --progress=plain apps/$*/
clean:
rm -f ./vault/plugins/vault-plugin-auth-sgx
rm -f ./premain ./vault/premain-vault
fmt:
go fmt $$(go list ./...)
.PHONY: build clean fmt start enable client premain premain-app premain-vault vault pccs