This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
95 lines (77 loc) · 2.75 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
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
# Copyright (c) 2018 NEC Laboratories Europe GmbH.
#
# Authors: Sergey Fedorov <sergey.fedorov@neclab.eu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
INSTALL := install
INSTALL_PROGRAM := $(INSTALL)
INSTALL_DATA := $(INSTALL) -m 644
builddir := sample/build
prefix ?= sample
bindir := $(prefix)/bin
libdir := $(prefix)/lib
.PHONY: all build install uninstall clean check test lint generate \
docker docker-clean
all: build check
test: check
usig-target-list := usig-help usig-all usig-build usig-clean \
usig-check usig-test usig-enclave usig-untrusted
.PHONY: $(usig-target-list)
.PHONY: help
help:
@echo 'Usage: make [target]...'
@echo ''
@echo 'Generic targets:'
@echo ' all (default) - Build and test all'
@echo ' build - Build all'
@echo ' install - Build and install artifacts'
@echo ' docker - Build a Docker image'
@echo ' docker-clean - Remove a Docker image'
@echo ' uninstall - Uninstall artifacts'
@echo ' clean - Remove all build artifacts'
@echo ' check|test - Run all tests'
@echo ' lint - Run code quality checks'
@echo ' generate - Generate dependent files'
@echo ''
@echo 'Specific targets:'
@echo ' usig-* - Make USIG target, where target is one of:'
@echo ' $(usig-target-list)'
build: prerequisite-check usig-build
go build -o $(builddir)/keytool ./sample/authentication/keytool
go build -o $(builddir)/peer ./sample/peer
install: build
$(INSTALL_PROGRAM) -D $(builddir)/keytool $(bindir)/keytool
$(INSTALL_PROGRAM) -D $(builddir)/peer $(bindir)/peer
$(INSTALL_DATA) -D usig/sgx/shim/libusig_shim.so $(libdir)/libusig_shim.so
$(INSTALL_DATA) -D usig/sgx/enclave/libusig.signed.so $(libdir)/libusig.signed.so
docker:
docker build -f sample/docker/Dockerfile -t minbft .
docker-clean:
docker rmi -f minbft
uninstall:
rm -f $(bindir)/keytool
rm -f $(bindir)/peer
rm -f $(libdir)/libusig_shim.so
rm -f $(libdir)/libusig.signed.so
clean: usig-clean
rm -rf $(builddir)
check: usig-build usig-check
go test -race ./...
lint:
golangci-lint run ./...
generate:
go generate ./...
prerequisite-check:
@bash tools/prerequisite-check.sh
$(usig-target-list):
$(MAKE) -C usig/sgx $(patsubst usig-%,%,$@)