From d18834b2902cf273ef67320cbad86e66d8f23763 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 15 Feb 2026 15:56:13 +0000 Subject: [PATCH] add macos target to makefile/taskfile --- Makefile | 10 ++++++++-- Taskfile.yml | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 75680d2..3489a12 100644 --- a/Makefile +++ b/Makefile @@ -5,24 +5,27 @@ 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 +33,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 ./... diff --git a/Taskfile.yml b/Taskfile.yml index ea82cea..f88cf9b 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -10,6 +10,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 @@ -25,6 +26,7 @@ tasks: cmds: - task: build-windows - task: build-linux + - task: build-macos vet: desc: Vet the code @@ -49,6 +51,12 @@ tasks: - GOOS=linux GOARCH=amd64 go build -o {{.LINUX}} -ldflags="-X main.Version={{.GIT_COMMIT}}" ./cmd/{{.PROGRAM}}/ internal: true + build-macos: + desc: Build the q3rcon-proxy 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 cmds: