This repository was archived by the owner on Jan 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
62 lines (47 loc) · 1.21 KB
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
#
# Makefile for Go
#
SHELL=/usr/bin/env bash
VERSION=$(shell git describe --tags --always)
PACKAGES = $(shell find ./ -type d | grep -v 'vendor' | grep -v '.git' | grep -v 'bin')
.PHONY: list
.PHONY: test-cover-html
default: build
dockerbuild:
docker build -t speedtest .
dockerrun:
docker run --rm -it speedtest
dockerclean:
docker-clean all
build:
go build -ldflags="-X main.Version=${VERSION}" -o bin/speedtest-${VERSION} ./cmd/speedtest
static:
CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-extldflags \"static\" -s -w" -o bin/speedtest ./cmd/speedtest
upx bin/speedtest
clean:
scripts/clean.sh
vet:
go vet ./cmd/...
go vet ./internal/...
lint:
golint ./cmd/...
golint ./internal/...
fmt:
gofmt -w ./cmd/speedtest
gofmt -w ./internal/coords
gofmt -w ./internal/misc
gofmt -w ./internal/print
gofmt -w ./internal/sthttp
gofmt -w ./internal/speedtests
test:
go test ./cmd/... ./internal/...
cover:
go test -cover ./cmd/... ./internal/...
coverage:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out
cross:
scripts/cross-compile.sh