From 8bc2e6e76bc0bb6973532440c6282d4dba1928c2 Mon Sep 17 00:00:00 2001 From: Chiran Fernando Date: Sun, 18 May 2025 16:30:05 +0530 Subject: [PATCH] Add windows build step to makefile --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b0d0926..fbf73d6 100644 --- a/Makefile +++ b/Makefile @@ -21,12 +21,12 @@ BUILD_OPTS := -v # Set test options TEST_OPTS := -v -race -.PHONY: all clean test fmt lint vet coverage help +.PHONY: all clean test fmt lint vet coverage help build-windows # Default target -all: lint test build-linux build-linux-arm build-darwin +all: lint test build-linux build-linux-arm build-darwin build-windows -build: clean test build-linux build-linux-arm build-darwin +build: clean test build-linux build-linux-arm build-darwin build-windows build-linux: mkdir -p $(BUILD_DIR)/linux @@ -46,6 +46,12 @@ build-darwin: -o $(BUILD_DIR)/darwin/openmcpauthproxy $(PROJECT_ROOT)/cmd/proxy cp config.yaml $(BUILD_DIR)/darwin +build-windows: + mkdir -p $(BUILD_DIR)/windows + GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -x -ldflags "-X main.version=$(BUILD_VERSION)" \ + -o $(BUILD_DIR)/windows/openmcpauthproxy.exe ./cmd/proxy + cp config.yaml $(BUILD_DIR)/windows + # Clean build artifacts clean: @echo "Cleaning build artifacts..."