-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (20 loc) · 795 Bytes
/
Makefile
File metadata and controls
27 lines (20 loc) · 795 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
BINARY := ktop-graph
VERSION ?= v0.1.0
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE := $(shell date -u +%Y-%m-%d)
LDFLAGS := -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)
.PHONY: build install run clean release
build:
GO111MODULE=on go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/ktop-graph
install: build
install -m 0755 bin/$(BINARY) /usr/local/bin/$(BINARY)
run:
go run -ldflags "$(LDFLAGS)" ./cmd/ktop-graph $(ARGS)
# run like this - make run ARGS='-n api-server -l app=api-server --persist'
tidy:
go mod tidy
clean:
rm -rf bin
# Example cross-compile (macOS arm64 and Linux amd64)
release:
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "$(LDFLAGS)" -o bin/$(BINARY) ./cmd/ktop-graph