-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
74 lines (58 loc) · 1.84 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
.PHONY: all
all: test install
ifeq ($(GOPATH),)
GOPATH=~/go
endif
# runs all tests and benchmarks
.PHONY: bench
bench: test
cd tests && go test -bench=.
# runs all tests
.PHONY: test
test:
go test ./...
# installs go-hash
.PHONY: install
install:
go install
# builds the website for local deployment
.PHONY: website
website: install
magnanimous -style=lovelace -globalctx=_local_global_context website
# builds the website for GitHub deployment
.PHONY: website-github
website-github: install
magnanimous website
# serve the website locally
.PHONY: serve
serve: website
go get -u github.com/m3ng9i/ran
ran -r website/target
# deploy to GitHub
.PHONY: deploy
deploy: website-github
./deploy-to-github.sh
# build a smaller executable without symbols and debug info for all supported OSs and ARCHs
.PHONY: release release-linux release-windows release-darwin
release-linux:
env GOOS=linux env GOARCH=amd64 go build -ldflags "-s -w" -o releases/magnanimous-linux-amd64
env GOOS=linux env GOARCH=386 go build -ldflags "-s -w" -o releases/magnanimous-linux-386
release-windows:
env GOOS=windows env GOARCH=amd64 go build -ldflags "-s -w" -o releases/magnanimous-windows-amd64.exe
env GOOS=windows env GOARCH=386 go build -ldflags "-s -w" -o releases/magnanimous-windows-386.exe
release-darwin:
env GOOS=darwin env GOARCH=amd64 go build -ldflags "-s -w" -o releases/magnanimous-darwin-amd64
release-darwin-arm:
env GOOS=darwin env GOARCH=arm64 go build -ldflags "-s -w" -o releases/magnanimous-darwin-arm64
release: test release-linux release-windows release-darwin release-darwin-arm
# clean build artifacts, i.e. everything that is not source code.
# Does not remove the installed binary.
.PHONY: clean
clean:
rm -f magnanimous
rm -rf releases
rm -rf website/target
# uninstall the binary
.PHONY: uninstall
uninstall:
rm -f $(GOPATH)/bin/magnanimous