File: GNUmakefile

package info (click to toggle)
golang-github-knqyf263-go-cpe 0.0~git20180327.659663f6-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 18,036 kB
  • sloc: sh: 11; makefile: 4
file content (56 lines) | stat: -rw-r--r-- 896 bytes parent folder | download | duplicates (2)
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
.PHONY: \
	all \
	dep \
	depup \
	update \
	build \
	install \
	lint \
	vet \
	fmt \
	fmtcheck \
	clean \
	pretest \
	test

SRCS = $(shell git ls-files '*.go')
PKGS = $(shell go list ./... | grep -v /vendor/)
COVERAGE_PKGS = $(shell go list ./... | grep -Ev "/testing|/examples")

all: dep build test

dep:
	go get -u github.com/golang/dep/...
	dep ensure

depup:
	go get -u github.com/golang/dep/...
	dep ensure -u

build: main.go dep
	go build -o go-cpe $<


lint:
	@ go get -v github.com/golang/lint/golint
	$(foreach file,$(SRCS),golint $(file) || exit;)

vet:
	go vet $(PKGS) || exit;

fmt:
	gofmt -w $(SRCS)

fmtcheck:
	@ $(foreach file,$(SRCS),gofmt -s -l $(file);)
cov:
	sh coverage.sh $(COVERAGE_PKGS) || exit;
	go tool cover -html=coverage.out -o coverage.html

clean:
	go clean $(shell glide nv)

pretest: vet fmtcheck

test: pretest
	@ $(foreach pkg,$(PKGS), go test $(pkg) || exit;)