2024-03-20 21:34:42 +01:00
|
|
|
gotag=1.20.14-bullseye
|
2022-03-30 01:30:29 +02:00
|
|
|
|
|
|
|
commit=$(shell git rev-parse HEAD)
|
|
|
|
|
|
|
|
dockercmd=docker run --rm -v $(CURDIR):/usr/src/bt2qbt -w /usr/src/bt2qbt
|
|
|
|
buildtags = -tags forceposix
|
|
|
|
buildenvs = -e CGO_ENABLED=0
|
2022-03-30 23:00:53 +02:00
|
|
|
version = 1.999
|
2022-03-30 01:30:29 +02:00
|
|
|
ldflags = -ldflags="-X 'main.version=$(version)' -X 'main.commit=$(commit)' -X 'main.buildImage=golang:$(gotag)'"
|
|
|
|
|
2023-11-25 21:48:16 +01:00
|
|
|
.PHONY: all tests build
|
|
|
|
|
2022-04-17 15:01:18 +02:00
|
|
|
all: | tests build
|
2022-03-30 01:30:29 +02:00
|
|
|
|
|
|
|
tests:
|
|
|
|
$(dockercmd) golang:$(gotag) go test $(buildtags) ./...
|
|
|
|
|
2022-04-17 15:01:18 +02:00
|
|
|
build: windows linux darwin
|
2022-03-30 01:30:29 +02:00
|
|
|
|
|
|
|
windows:
|
|
|
|
$(dockercmd) $(buildenvs) -e GOOS=windows -e GOARCH=amd64 golang:$(gotag) go build -v $(buildtags) $(ldflags) -o bt2qbt_v$(version)_amd64.exe
|
|
|
|
$(dockercmd) $(buildenvs) -e GOOS=windows -e GOARCH=386 golang:$(gotag) go build -v $(buildtags) $(ldflags) -o bt2qbt_v$(version)_i386.exe
|
|
|
|
|
|
|
|
linux:
|
|
|
|
$(dockercmd) $(buildenvs) -e GOOS=linux -e GOARCH=amd64 golang:$(gotag) go build -v $(buildtags) $(ldflags) -o bt2qbt_v$(version)_amd64_linux
|
|
|
|
$(dockercmd) $(buildenvs) -e GOOS=linux -e GOARCH=386 golang:$(gotag) go build -v $(buildtags) $(ldflags) -o bt2qbt_v$(version)_i386_linux
|
|
|
|
|
|
|
|
darwin:
|
|
|
|
$(dockercmd) $(buildenvs) -e GOOS=darwin -e GOARCH=amd64 golang:$(gotag) go build -v $(buildtags) $(ldflags) -o bt2qbt_v$(version)_amd64_macos
|
2022-04-17 15:09:14 +02:00
|
|
|
$(dockercmd) $(buildenvs) -e GOOS=darwin -e GOARCH=arm64 golang:$(gotag) go build -v $(buildtags) $(ldflags) -o bt2qbt_v$(version)_arm64_macos
|