-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (21 loc) · 738 Bytes
/
Makefile
File metadata and controls
30 lines (21 loc) · 738 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
.PHONY: build run clean test lint tidy
BINARY := tokenomics
BUILD_DIR := ./bin
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS := -X github.com/rickcrawford/tokenomics/cmd.Version=$(VERSION) \
-X github.com/rickcrawford/tokenomics/cmd.Commit=$(COMMIT) \
-X github.com/rickcrawford/tokenomics/cmd.BuildDate=$(DATE)
build:
go build -ldflags "$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY) .
run: build
$(BUILD_DIR)/$(BINARY) serve
clean:
rm -rf $(BUILD_DIR) certs tokenomics.db
test:
go test ./...
lint:
golangci-lint run ./...
tidy:
go mod tidy