aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2018-01-03 13:48:27 +0000
committerFelix Hanley <felix@userspace.com.au>2018-01-03 13:48:27 +0000
commit9ac76d815bbf58bf277155354c5e61541d5ce2cc (patch)
tree9a3ce8d91a499878fa2783b7657b6a584257a5d0 /Makefile
parentc428d3bbcd66b64d55297a772cb71ed5e0767614 (diff)
downloaddhtsearch-9ac76d815bbf58bf277155354c5e61541d5ce2cc.tar.gz
dhtsearch-9ac76d815bbf58bf277155354c5e61541d5ce2cc.tar.bz2
Add makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 23 insertions, 0 deletions
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