#!/bin/bash

echo "Building Medi-WOL for multiple platforms..."

# Erstelle dist-Verzeichnis
mkdir -p dist

echo "Building for Linux AMD64..."
go build -ldflags="-s -w" -o dist/medi-wol-linux-amd64 cmd/server/main.go

echo "Building for Linux ARM64..."
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o dist/medi-wol-linux-arm64 cmd/server/main.go

echo "Building for Windows AMD64..."
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o dist/medi-wol-windows-amd64.exe cmd/server/main.go

echo "Building for Windows ARM64..."
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o dist/medi-wol-windows-arm64.exe cmd/server/main.go

echo ""
echo "Build complete! Binaries created in dist/ folder:"
ls -la dist/
echo ""
