-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
70 lines (62 loc) · 2.45 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
PROJECT = transfer
VERSION ="$(echo $TRAVIS_TAG)"
ARCNAME = $(PROJECT)-$(VERSION)-$(GOOS)-$(GOARCH)
all: release-all
release:
env CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(FLAGS) -ldflags='-s -w -X github.com/rinetd/transfer/version.Version=$(VERSION)' -o build/$(GOOS)-$(GOARCH)/$(PROJECT)$(EXT)
tar czf build/$(ARCNAME).tar.gz -C build/$(GOOS)-$(GOARCH)/ $(PROJECT)$(EXT)
.PHONY: release-all
release-all:
-@$(MAKE) release GOOS=darwin GOARCH=amd64
-@$(MAKE) release GOOS=linux GOARCH=386
-@$(MAKE) release GOOS=linux GOARCH=amd64
-@$(MAKE) release GOOS=windows GOARCH=386 EXT=.exe
-@$(MAKE) release GOOS=windows GOARCH=amd64 EXT=.exe
platform:
# @$(MAKE) releaseGOOS=js GOARCH=wasm
# @$(MAKE) release GOOS=windows GOARCH=386 FLAGS='-ldflags="-H=windowsgui"' EXE=.exe
# @$(MAKE) release GOOS=windows GOARCH=amd64 FLAGS='-ldflags="-H=windowsgui"' EXE=.exe
# @$(MAKE) release GOOS=linux GOARCH=arm
# @$(MAKE) release GOOS=linux GOARCH=arm64
# @$(MAKE) release GOOS=linux GOARCH=mips
# @$(MAKE) release GOOS=linux GOARCH=mips64
# @$(MAKE) release GOOS=linux GOARCH=mips64le
# @$(MAKE) release GOOS=linux GOARCH=mipsle
# @$(MAKE) release GOOS=linux GOARCH=ppc64
# @$(MAKE) release GOOS=linux GOARCH=ppc64le
# @$(MAKE) release GOOS=linux GOARCH=s390x
# @$(MAKE) release GOOS=android GOARCH=386
# @$(MAKE) release GOOS=android GOARCH=amd64
# @$(MAKE) release GOOS=android GOARCH=arm
# @$(MAKE) release GOOS=android GOARCH=arm64
# @$(MAKE) release GOOS=darwin GOARCH=386
# @$(MAKE) release GOOS=darwin GOARCH=arm
# @$(MAKE) release GOOS=darwin GOARCH=arm64
# @$(MAKE) release GOOS=dragonfly GOARCH=amd64
# @$(MAKE) release GOOS=freebsd GOARCH=386
# @$(MAKE) release GOOS=freebsd GOARCH=amd64
# @$(MAKE) release GOOS=freebsd GOARCH=arm
# @$(MAKE) release GOOS=nacl GOARCH=386
# @$(MAKE) release GOOS=nacl GOARCH=amd64p32
# @$(MAKE) release GOOS=nacl GOARCH=arm
# @$(MAKE) release GOOS=netbsd GOARCH=386
# @$(MAKE) release GOOS=netbsd GOARCH=amd64
# @$(MAKE) release GOOS=netbsd GOARCH=arm
# @$(MAKE) release GOOS=openbsd GOARCH=386
# @$(MAKE) release GOOS=openbsd GOARCH=amd64
# @$(MAKE) release GOOS=openbsd GOARCH=arm
# @$(MAKE) release GOOS=plan9 GOARCH=386
# @$(MAKE) release GOOS=plan9 GOARCH=amd64
# @$(MAKE) release GOOS=plan9 GOARCH=arm
# @$(MAKE) release GOOS=solaris GOARCH=amd64
.PHONY: build
build:
go get ./...
.PHONY: test
test:
go get -t ./...
go test -v ...
build-image:
docker build -t rientd/transfer .
clean:
rm -rf build dist