From 9ac76d815bbf58bf277155354c5e61541d5ce2cc Mon Sep 17 00:00:00 2001 From: Felix Hanley Date: Thu, 4 Jan 2018 00:48:27 +1100 Subject: Add makefile --- Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b8a04cf --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ + +BINARY=dht-search +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 -- cgit v1.2.3