-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
51 lines (40 loc) · 1.55 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
.PHONY: all
all: test check coverage build
.PHONY: build
build: livesim2 dashfetcher cmaf-ingest-receiver
.PHONY: prepare
prepare:
go mod vendor
livesim2 dashfetcher cmaf-ingest-receiver:
go build -ldflags "-X github.com/Dash-Industry-Forum/livesim2/internal.commitVersion=$$(git describe --tags HEAD) -X github.com/Dash-Industry-Forum/livesim2/internal.commitDate=$$(git log -1 --format=%ct)" -o out/$@ ./cmd/$@/main.go
forlinux: prepare
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/Dash-Industry-Forum/livesim2/internal.commitVersion=$$(git describe --tags HEAD) -X github.com/Dash-Industry-Forum/livesim2/internal.commitDate=$$(git log -1 --format=%ct)" -o out-linux/livesim2 ./cmd/livesim2/main.go
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/Dash-Industry-Forum/livesim2/internal.commitVersion=$$(git describe --tags HEAD) -X github.com/Dash-Industry-Forum/livesim2/internal.commitDate=$$(git log -1 --format=%ct)" -o out-linux/dashfetcher ./cmd/dashfetcher/main.go
.PHONY: test
test: prepare
go test ./...
.PHONY: coverage
coverage:
# Ignore (allow) packages without any tests
set -o pipefail
go test ./... -coverprofile coverage.out
set +o pipefail
go tool cover -html=coverage.out -o coverage.html
go tool cover -func coverage.out -o coverage.txt
tail -1 coverage.txt
.PHONY: check
check: prepare
golangci-lint run
.PHONY: clean
clean:
rm -f out/*
rm -r examples-out/*
.PHONY: install
install: all
cp out/* $(GOPATH)/bin/
.PHONY: update
update:
go get -t -u ./...
.PHONY: check-licenses
check-licenses: prepare
wwhrd check