aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f71992c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+VERSION ?= $(shell cat VERSION 2>/dev/null || echo dev)
+COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
+BUILD_DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
+
+LDFLAGS := -s -w \
+ -X main.version=$(VERSION) \
+ -X main.commit=$(COMMIT) \
+ -X main.buildDate=$(BUILD_DATE)
+
+.PHONY: build test
+
+build:
+ go build -trimpath -ldflags "$(LDFLAGS)" -o ./bin/plutia ./cmd/plutia
+
+test:
+ go test ./...