-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
36 lines (29 loc) · 1.43 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
build:
go mod tidy && go mod vendor
go build -o ./bin/go-live && chmod +X ./bin/*
echo "Executable Ready in ./bin/go-live"
docker:
docker build -t antsankov/go-live:latest .
format:
gofmt -l -s -w .
# Compiled with Arch Go package guidelines and removed whitespace.
cross-compile:
env GOOS=linux GOARCH=arm go build -o ./release/go-live-linux-arm32 -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=linux GOARCH=arm64 go build -o ./release/go-live-linux-arm64 -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=darwin GOARCH=amd64 go build -o ./release/go-live-mac-x64 -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=linux GOARCH=386 go build -o ./release/go-live-linux-x32 -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=linux GOARCH=amd64 go build -o ./release/go-live-linux-x64 -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=windows GOARCH=386 go build -o ./release/go-live-windows-x32.exe -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=windows GOARCH=amd64 go build -o ./release/go-live-windows-x64.exe -ldflags "-s -w" -trimpath -mod=readonly
env GOOS=darwin GOARCH=arm64 go build -o ./release/go-live-mac-arm64 -ldflags "-s -w" -trimpath -mod=readonly
m1:
env GOOS=darwin GOARCH=arm64 go build -o ./release/go-live-mac-arm64 -ldflags "-s -w" -trimpath -mod=readonly
test:
go test ./... -coverprofile=coverage.out
go tool cover -html=coverage.out
clean:
rm -rf ./bin/*
rm -rf ./release/*
rm -rf ./vendor/*
run:
./bin/go-live