forked from alajmo/mani
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.19 KB
/
Copy pathMakefile
File metadata and controls
48 lines (36 loc) · 1.19 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
40
41
42
43
44
45
46
47
48
NAME := mani
PACKAGE := github.com/alajmo/$(NAME)
DATE := $(shell date +%FT%T%Z)
GIT := $(shell [ -d .git ] && git rev-parse --short HEAD)
VERSION := v0.10.0
default: build
tidy:
go get -u && go mod tidy
lint:
golangci-lint run ./cmd/... ./core/...
test:
golangci-lint run
./test/scripts/test --build --count 5 --clean
build:
CGO_ENABLED=0 go build \
-ldflags "-w -X ${PACKAGE}/cmd.version=${VERSION} -X ${PACKAGE}/cmd.commit=${GIT} -X ${PACKAGE}/cmd.date=${DATE}" \
-a -tags netgo -o dist/${NAME} main.go
build-all:
goreleaser --rm-dist --snapshot
build-test:
CGO_ENABLED=0 go build \
-ldflags "-X '${PACKAGE}/core/dao.build_mode=TEST'" \
-a -tags netgo -o dist/${NAME} main.go
build-exec:
./test/scripts/exec
build-and-link:
go build \
-ldflags "-w -X ${PACKAGE}/cmd.version=${VERSION} -X ${PACKAGE}/cmd.commit=${GIT} -X ${PACKAGE}/cmd.date=${DATE}" \
-a -tags netgo -o dist/${NAME} main.go
cp ./dist/mani ~/.local/bin/mani
./dist/mani completion bash > ~/workstation/code/scripts/completions/mani-completion.sh
release:
git tag ${VERSION} && git push origin ${VERSION}
clean:
$(RM) -r dist target
.PHONY: lint test interactive build build-all build-test release clean