-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (32 loc) · 1.18 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
.PHONY: all test clean build install examples setup test-setup test-keys
SHELL := /bin/bash
GOFLAGS ?= -ldflags=\"-extldflags=-static\" $(GOFLAGS:)
BENCHARGS ?= -run=NONE -bench=. -benchmem
export KIEBITZ_TEST = yes
KIEBITZ_TEST_SETTINGS ?= "$(shell pwd)/settings/test"
KIEBITZ_ADMIN_SETTINGS ?= "$(KIEBITZ_TEST_SETTINGS)/002_admin.json"
all: dep install
build:
CGO_ENABLED=0 go build $(GOFLAGS) ./...
dep:
@go get ./...
install:
CGO_ENABLED=0 go install $(GOFLAGS) ./...
test-setup: dep install test-keys
test-keys:
KIEBITZ_SETTINGS=$(KIEBITZ_TEST_SETTINGS) kiebitz admin keys setup
test: test-setup
KIEBITZ_SETTINGS=$(KIEBITZ_TEST_SETTINGS) go test $(testargs) `go list ./...`
test-races: test-setup
KIEBITZ_SETTINGS=$(KIEBITZ_TEST_SETTINGS) go test -race $(testargs) `go list ./...`
bench: test-setup
KIEBITZ_SETTINGS=$(KIEBITZ_TEST_SETTINGS) go test $(BENCHARGS) $(GOFLAGS) `go list ./... | grep -v api/`
clean:
@go clean $(GOFLAGS) -i ./...
copyright:
python3 .scripts/make_copyright_headers.py
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)