-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (63 loc) · 1.52 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
MODULE=github.com/gumieri/p
GOBUILD=go build -ldflags "-X ${MODULE}/cmd.Version=${VERSION}"
define RELEASE_BODY
Go to the [README](https://github.com/gumieri/p/blob/${VERSION}/README.md) to know how to use it.
If you are using Mac OS or Linux, you can install using the commands:
```bash
curl -L https://github.com/gumieri/p/releases/download/${VERSION}/p-`uname -s`-`uname -m` -o /usr/local/bin/p
chmod +x /usr/local/bin/p
```
If you already have an older version installed, just run:
```bash
p upgrade
```
endef
export RELEASE_BODY
all: deps build
deps:
go get ./...
upgrade:
go get -u ./...
go mod tidy
build:
$(GOBUILD)
install:
go install
release-body:
echo "$$RELEASE_BODY" > RELEASE.md
build-linux-64:
GOOS=linux \
GOARCH=amd64 \
$(GOBUILD) -o release/p-Linux-x86_64
build-linux-86:
GOOS=linux \
GOARCH=386 \
$(GOBUILD) -o release/p-Linux-i386
build-linux-arm5:
GOOS=linux \
GOARCH=arm \
GOARM=5 \
$(GOBUILD) -o release/p-Linux-armv5l
build-linux-arm6:
GOOS=linux \
GOARCH=arm \
GOARM=6 \
$(GOBUILD) -o release/p-Linux-armv6l
build-linux-arm7:
GOOS=linux \
GOARCH=arm \
GOARM=7 \
$(GOBUILD) -o release/p-Linux-armv7l
build-linux-arm8:
GOOS=linux \
GOARCH=arm64 \
$(GOBUILD) -o release/p-Linux-armv8l
build-macos-64:
GOOS=darwin \
GOARCH=amd64 \
$(GOBUILD) -o release/p-Darwin-x86_64
build-macos-arm64:
GOOS=darwin \
GOARCH=arm64 \
$(GOBUILD) -o release/p-Darwin-arm64
build-all: build-linux-64 build-linux-86 build-linux-arm5 build-linux-arm6 build-linux-arm7 build-linux-arm8 build-macos-64 build-macos-arm64