-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 746 Bytes
/
Makefile
File metadata and controls
39 lines (31 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
33
34
35
36
37
38
39
BIN_CLI = bbnotes
DATE = $(shell date +%Y%m%d%H)
GIT_HASH = g$(shell git rev-parse --short HEAD)
PKG = bellbird-notes/app
GOFLAGS = -trimpath
VERSION := $(shell git describe --tags --abbrev=0 || echo "dev")
all:
go mod tidy
go build $(GOFLAGS) -ldflags="\
-s -w -X '$(PKG).version=$(VERSION)' \
-X '$(PKG).commit=$(GIT_HASH)'" \
-o ${BIN_CLI} cmd/tui/main.go
dev:
go mod tidy
go build $(GOFLAGS) -ldflags="\
-X '$(PKG).dev=true' \
-X '$(PKG).version=$(VERSION)' \
-X '$(PKG).commit=$(GIT_HASH)'" \
-o ${BIN_CLI} cmd/tui/main.go
install-local:
rsync -azP ${BIN_CLI} ~/.local/bin/
install:
rsync -azP ${BIN_CLI} /usr/bin/
clean:
go clean
rm ${BIN_CLI}
.PHONY: test
test:
go test ./...
test-verbose:
go test ./... -v