-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 699 Bytes
/
Makefile
File metadata and controls
30 lines (24 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
VERSION ?= dev
GIT_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.ver=$(VERSION) \
-X main.gitCommit=$(GIT_COMMIT) \
-X main.buildDate=$(BUILD_DATE)
.PHONY: build install test lint clean
build:
go build -ldflags '$(LDFLAGS)' -o clime .
install:
go install -ldflags '$(LDFLAGS)' .
@BIN_DIR="$$(go env GOBIN)"; \
if [ -z "$$BIN_DIR" ]; then BIN_DIR="$$(go env GOPATH)/bin"; fi; \
if [ -x "$$BIN_DIR/clime" ]; then \
echo "Running clime init..."; \
PATH="$$BIN_DIR:$$PATH" "$$BIN_DIR/clime" init || true; \
fi
test:
go test ./... -v
lint:
go vet ./...
clean:
rm -f clime