forked from strangelove-ventures/lens
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (19 loc) · 687 Bytes
/
Makefile
File metadata and controls
28 lines (19 loc) · 687 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
VERSION := $(shell git describe --tags)
COMMIT := $(shell git log -1 --format='%H')
all: test install
LD_FLAGS = -X github.com/strangelove-ventures/lens/cmd.Version=$(VERSION) \
-X github.com/strangelove-ventures/lens/cmd.Commit=$(COMMIT) \
BUILD_FLAGS := -ldflags '$(LD_FLAGS)'
build:
@echo "Building 20/20 vision"
@go build -mod readonly $(BUILD_FLAGS) -o build/lens main.go
test:
@go test -mod=readonly -race ./...
install:
@echo "Installing Lens"
@go install -mod readonly $(BUILD_FLAGS) ./...
build-linux:
@GOOS=linux GOARCH=amd64 go build --mod readonly $(BUILD_FLAGS) -o ./build/lens main.go
clean:
rm -rf build
.PHONY: all lint test race msan tools clean build