aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: d13acb96416b889f1d176a4766aef7c1d762c56c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
BINARY=dhtsearch
VERSION=$(shell git describe --tags --always)
SRC=$(shell find . -type f -name '*.go')

build: $(BINARY)

$(BINARY): $(SRC)
	go build -ldflags "-w -s \
		-X main.version=$(VERSION)" \
		-o $(BINARY)
test:
	go test -short -coverprofile=coverage.out
	go tool cover -html=coverage.out -o coverage.html

lint:
	@for file in $$(find . -name 'vendor' -prune -o -type f -name '*.go'); do golint $$file; done

clean:
	rm -f $(BINARY)
	rm -rf coverage*

.PHONY: install build test lint clean