-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 746 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (22 loc) · 746 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
31
32
.PHONY: build clean test run
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS := -X main.Version=$(VERSION) -X main.Commit=$(COMMIT) -X main.BuildTime=$(BUILD_TIME)
build:
go build -ldflags="$(LDFLAGS)" -o moenet-agent ./cmd/moenet-agent
build-linux:
GOOS=linux GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o moenet-agent-linux-amd64 ./cmd/moenet-agent
clean:
rm -f moenet-agent moenet-agent-linux-*
test:
go test -v ./...
run: build
./moenet-agent -c configs/config.example.json
fmt:
go fmt ./...
lint:
golangci-lint run
deps:
go mod tidy
go mod download