aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2018-08-01 01:16:06 +0100
committerNiall Sheridan <nsheridan@gmail.com>2018-08-01 01:51:36 +0100
commit8ab6dc3212b43c114353a578e32e3bc07bb8516b (patch)
tree2646293b4dcf7873d94d6eeecb6800665e618513 /Makefile
parente2b4c3882762406fd3da16f5865cfc3e36e048b5 (diff)
Switch to a Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1c1f8bc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+CASHIER_CMD := ./cmd/cashier
+CASHIER_BIN := ./cashier
+CASHIERD_BIN := ./cashierd
+CASHIERD_CMD := ./cmd/cashierd
+SRC_FILES = $(shell find * -type f -name '*.go' -not -path 'vendor/*' -not -name 'a_*-packr.go')
+
+all: test build
+
+test: dep
+ go test ./...
+ go install -race $(CASHIER_CMD) $(CASHIERD_CMD)
+ go vet ./...
+ go list ./... |egrep -v 'vendor/|proto$$' |xargs -L1 golint -set_exit_status
+ gofmt -d $(SRC_FILES)
+
+build: cashier cashierd
+
+generate:
+ go generate -x ./...
+
+cashier:
+ go build -o cashier $(CASHIER_CMD)
+
+cashierd: generate
+ go build -o cashierd $(CASHIERD_CMD)
+
+clean:
+ rm -f cashier cashierd
+
+dep:
+ go get -u github.com/golang/lint/golint
+
+.PHONY: dep generate test cashier cashierd \ No newline at end of file