-
Notifications
You must be signed in to change notification settings - Fork 84
/
Makefile
48 lines (36 loc) · 1.14 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
.PHONY: all
all: test check coverage build
.PHONY: build
build: mp4ff-crop mp4ff-decrypt mp4ff-encrypt mp4ff-info mp4ff-nallister mp4ff-pslister mp4ff-subslister examples
.PHONY: prepare
prepare:
go mod vendor
mp4ff-crop mp4ff-decrypt mp4ff-encrypt mp4ff-info mp4ff-nallister mp4ff-pslister mp4ff-subslister:
go build -ldflags "-X github.com/Eyevinn/mp4ff/mp4.commitVersion=$$(git describe --tags HEAD) -X github.com/Eyevinn/mp4ff/mp4.commitDate=$$(git log -1 --format=%ct)" -o out/$@ ./cmd/$@/main.go
.PHONY: examples
examples: initcreator multitrack resegmenter segmenter
initcreator multitrack resegmenter segmenter:
go build -o examples-out/$@ ./examples/$@
.PHONY: test
test: prepare
go test ./...
.PHONY: testsum
testsum: prepare
gotestsum
.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
clean:
rm -f out/*
rm -r examples-out/*
install: all
cp out/* $(GOPATH)/bin/