-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (44 loc) · 1.48 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
## simple makefile to log workflow
.PHONY: all test clean build install protobuf examples
SHELL := /bin/bash
VERSION ?= development
SD ?= default
GOFLAGS ?= $(GOFLAGS:) -ldflags "-X 'github.com/iris-connect/hyper.Version=$(VERSION)'"
export HYPER_TEST = yes
HYPER_TEST_SETTINGS ?= "$(shell pwd)/settings/test"
all: dep install
build:
go build $(GOFLAGS) ./...
dep:
@go get ./...
install: build
go install $(GOFLAGS) ./...
test:
HYPER_SETTINGS=$(HYPER_TEST_SETTINGS) go test $(testargs) `go list ./...`
test-races:
HYPER_SETTINGS=$(HYPER_TEST_SETTINGS) go test -race $(testargs) `go list ./...`
bench:
HYPER_SETTINGS=$(HYPER_TEST_SETTINGS) go test -run=NONE -bench=. $(GOFLAGS) `go list ./... | grep -v api/`
clean:
@go clean $(GOFLAGS) -i ./...
copyright:
python3 .scripts/make_copyright_headers.py
protobuf:
protoc --go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
protobuf/hyper.proto
certs:
rm -rf settings/dev/certs/*
rm -rf settings/test/certs/*
(cd settings/dev/certs; ../../../.scripts/make_certs.sh)
(cd settings/test/certs; ../../../.scripts/make_certs.sh)
sd-setup:
# we always reset the directory and load the certs
.scripts/sd_setup.sh settings/dev/directory --reset
# then we load additional entries
.scripts/sd_setup.sh settings/dev/directory/$(SD)
sd-test-setup:
.scripts/sd_setup.sh settings/test/directory
examples:
@go build $(GOFLAGS) -tags examples ./...
@go install $(GOFLAGS) -tags examples ./...