mirror of
https://github.com/onyx-and-iris/q3rcon.git
synced 2026-02-16 02:07:53 +00:00
add macos target to Taskfile/makefile
This commit is contained in:
parent
e25104091d
commit
c04301562e
10
Taskfile.yml
10
Taskfile.yml
@ -7,6 +7,7 @@ vars:
|
||||
|
||||
WINDOWS: '{{.BIN_DIR}}/{{.PROGRAM}}_windows_amd64.exe'
|
||||
LINUX: '{{.BIN_DIR}}/{{.PROGRAM}}_linux_amd64'
|
||||
MACOS: '{{.BIN_DIR}}/{{.PROGRAM}}_darwin_amd64'
|
||||
GIT_COMMIT:
|
||||
sh: git log -n 1 --format=%h
|
||||
|
||||
@ -22,6 +23,7 @@ tasks:
|
||||
cmds:
|
||||
- task: build-windows
|
||||
- task: build-linux
|
||||
- task: build-macos
|
||||
|
||||
vet:
|
||||
desc: Vet the code
|
||||
@ -38,11 +40,19 @@ tasks:
|
||||
desc: Build the q3rcon project for Windows
|
||||
cmds:
|
||||
- GOOS=windows GOARCH=amd64 go build -o {{.WINDOWS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
|
||||
internal: true
|
||||
|
||||
build-linux:
|
||||
desc: Build the q3rcon project for Linux
|
||||
cmds:
|
||||
- GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
|
||||
internal: true
|
||||
|
||||
build-macos:
|
||||
desc: Build the q3rcon project for macOS
|
||||
cmds:
|
||||
- GOOS=darwin GOARCH=amd64 go build -o {{.MACOS}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/
|
||||
internal: true
|
||||
|
||||
test:
|
||||
desc: Run tests
|
||||
|
||||
9
makefile
9
makefile
@ -5,24 +5,26 @@ BIN_DIR := bin
|
||||
|
||||
WINDOWS=$(BIN_DIR)/$(PROGRAM)_windows_amd64.exe
|
||||
LINUX=$(BIN_DIR)/$(PROGRAM)_linux_amd64
|
||||
MACOS=$(BIN_DIR)/$(PROGRAM)_darwin_amd64
|
||||
VERSION=$(shell git log -n 1 --format=%h)
|
||||
|
||||
.DEFAULT_GOAL := build
|
||||
|
||||
.PHONY: fmt vet build windows linux test clean
|
||||
.PHONY: fmt vet build windows linux macos test clean
|
||||
fmt:
|
||||
$(GO) fmt ./...
|
||||
|
||||
vet: fmt
|
||||
$(GO) vet ./...
|
||||
|
||||
build: vet windows linux | $(BIN_DIR)
|
||||
build: vet windows linux macos | $(BIN_DIR)
|
||||
@echo version: $(VERSION)
|
||||
|
||||
windows: $(WINDOWS)
|
||||
|
||||
linux: $(LINUX)
|
||||
|
||||
macos: $(MACOS)
|
||||
|
||||
$(WINDOWS):
|
||||
env GOOS=windows GOARCH=amd64 go build -v -o $(WINDOWS) -ldflags="-s -w -X main.version=$(VERSION)" ./cmd/$(PROGRAM)/
|
||||
@ -30,6 +32,9 @@ $(WINDOWS):
|
||||
$(LINUX):
|
||||
env GOOS=linux GOARCH=amd64 go build -v -o $(LINUX) -ldflags="-s -w -X main.version=$(VERSION)" ./cmd/$(PROGRAM)/
|
||||
|
||||
$(MACOS):
|
||||
env GOOS=darwin GOARCH=amd64 go build -v -o $(MACOS) -ldflags="-s -w -X main.version=$(VERSION)" ./cmd/$(PROGRAM)/
|
||||
|
||||
test:
|
||||
$(GO) test ./...
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user