forked from larksuite/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 1.01 KB
/
Makefile
File metadata and controls
39 lines (28 loc) · 1.01 KB
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
33
34
35
36
37
38
39
# Copyright (c) 2026 Lark Technologies Pte. Ltd.
# SPDX-License-Identifier: MIT
BINARY := lark-cli
MODULE := github.com/larksuite/cli
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
DATE := $(shell date +%Y-%m-%d)
LDFLAGS := -s -w -X $(MODULE)/internal/build.Version=$(VERSION) -X $(MODULE)/internal/build.Date=$(DATE)
PREFIX ?= /usr/local
.PHONY: build vet test unit-test integration-test install uninstall clean fetch_meta
fetch_meta:
python3 scripts/fetch_meta.py
build: fetch_meta
go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) .
vet: fetch_meta
go vet ./...
unit-test: fetch_meta
go test -race -gcflags="all=-N -l" -count=1 ./cmd/... ./internal/... ./shortcuts/...
integration-test: build
go test -v -count=1 ./tests/...
test: vet unit-test integration-test
install: build
install -d $(PREFIX)/bin
install -m755 $(BINARY) $(PREFIX)/bin/$(BINARY)
@echo "OK: $(PREFIX)/bin/$(BINARY) ($(VERSION))"
uninstall:
rm -f $(PREFIX)/bin/$(BINARY)
clean:
rm -f $(BINARY)