-
Notifications
You must be signed in to change notification settings - Fork 60
/
Makefile
86 lines (70 loc) · 1.85 KB
/
Makefile
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
NAME = jump
DESCRIPTION = "Jump helps you navigate faster by learning your habits."
HOMEPAGE = https://github.com/gsamokovarov/jump
AUTHOR = "Genadi Samokovarov"
LICENSE = MIT
VERSION = 0.51.0
.PHONY: build
build:
@env CGO_ENABLED=0 go build -o jump
.PHONY: build.linux
build.linux:
@env GOOS=linux go build -buildvcs=false -o jump
.PHONY: build.linux.arm
build.linux.arm:
@env GOOS=linux GOARCH=arm64 go build -o jump
.PHONY: build.arm
build.arm:
@env GOARCH=arm64 go build -o jump
.PHONY: build.windows
build.windows:
@env GOOS=windows GOARCH=amd64 go build -o jump.exe
.PHONY: test
test:
@rm -rf ./config/testdata/.tmp*
@go test ./... -cover
.PHONY: lint
lint:
@go vet ./... && golint ./...
.PHONY: clean
clean:
@rm -f jump*
.PHONY: pkg
pkg: pkg.deb pkg.rpm pkg.linux pkg.linux.arm
.PHONY: pkg.deb
pkg.deb: man build.linux
@fpm -s dir -t deb -n $(NAME) -v $(VERSION) -a amd64 \
--deb-compression bzip2 \
--url $(HOMEPAGE) \
--description $(DESCRIPTION) \
--vendor $(AUTHOR) \
--license $(LICENSE) \
-m "Genadi Samokovarov <[email protected]>" \
./jump=/usr/bin/jump \
./man/jump.1=/usr/share/man/man1/jump.1 \
./man/j.1=/usr/share/man/man1/j.1
.PHONY: pkg.rpm
pkg.rpm: man build.linux
@fpm -s dir -t rpm -n $(NAME) -v $(VERSION) -a amd64 \
--rpm-compression bzip2 \
--url $(HOMEPAGE) \
--description $(DESCRIPTION) \
--vendor $(AUTHOR) \
--license $(LICENSE) \
-m "Genadi Samokovarov <[email protected]>" \
./jump=/usr/bin/jump \
./man/jump.1=/usr/share/man/man1/jump.1 \
./man/j.1=/usr/share/man/man1/j.1
.PHONY: pkg.linux
pkg.linux: build.linux
@mv jump jump_linux_amd64_binary
.PHONY: pkg.linux.arm
pkg.linux.arm: man build.linux.arm
@mv jump jump_linux_arm_binary
.PHONY: man
man: ronn
@ronn ./man/jump.1.ronn --style=dark
@cp ./man/jump.1 ./man/j.1
.PHONY: ronn
ronn:
@which ronn > /dev/null || gem install ronn