-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.4 KB
/
Makefile
File metadata and controls
43 lines (34 loc) · 1.4 KB
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
.DEFAULT_GOAL := dev
NAME = cold
OS = linux
ARCH = amd64
VERSION := $(shell git describe --tags --abbrev=0)
build: clean
@GOOS=linux GOARCH=amd64 go build -o bin/${NAME}-amd64-linux-${VERSION} -ldflags "-X github.com/axyut/cold/cmd.Version=${VERSION}" .
@GOOS=darwin GOARCH=amd64 go build -o bin/${NAME}-amd64-darwin-${VERSION} -ldflags "-X github.com/axyut/cold/cmd.Version=${VERSION}" .
@GOOS=windows GOARCH=amd64 go build -o bin/${NAME}-amd64-windows-${VERSION} -ldflags "-X github.com/axyut/cold/cmd.Version=${VERSION}" .
build_arm:
GOOS=darwin GOARCH=arm64 go build -o bin/${NAME}-arm64-darwin-${VERSION} -ldflags "-X github.com/axyut/cold/cmd.Version=${VERSION}" .
GOOS=windows GOARCH=arm64 go build -o bin/${NAME}-arm64-windows-${VERSION} -ldflags "-X github.com/axyut/cold/cmd.Version=${VERSION}" .
GOOS=linux GOARCH=arm64 go build -o bin/${NAME}-arm64-linux-${VERSION} -ldflags "-X github.com/axyut/cold/cmd.Version=${VERSION}" .
# https://issueantenna.com/repo/ebitengine/oto/issues/238
# https://stackoverflow.com/questions/51475992/cgo-cross-compiling-from-amd64linux-to-arm64linux
clean:
@rm -rf bin
test:
@go test -v ./...
dev:
@go run .
release:
@goreleaser release --snapshot --clean
run: build
@bin/${NAME}-${ARCH}-${OS}-${VERSION}
install:
sudo apt install libasound2-dev
go mod tidy
lint:
@golangci-lint run
git: lint test # make git m="your message"
git add .
git commit -m "$(m)"
git push