From 6e5fc57b60e9d27360b6477de81bc0ed74bbdec8 Mon Sep 17 00:00:00 2001 From: pjoyce Date: Fri, 22 May 2026 08:43:42 -0400 Subject: [PATCH] win make --- Makefile_Windows | 14 ++++++++++++++ README.md | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Makefile_Windows diff --git a/Makefile_Windows b/Makefile_Windows new file mode 100644 index 0000000..ca8e431 --- /dev/null +++ b/Makefile_Windows @@ -0,0 +1,14 @@ +BINDIR = C:\tools + +# Requires `make` with PowerShell as the shell. Easiest way: +# make -f Makefile_Windows SHELL=pwsh.exe install +# `cp` / `rm` resolve to PowerShell aliases, `New-Item` is PowerShell-native. + +install: ## Install Target + go build -o ${BINDIR}/kxd/_kxd_prompt.exe + cp scripts/_kxd.ps1 ${BINDIR}/kxd/_kxd.ps1 + cp scripts/_kxd_autocomplete.ps1 ${BINDIR}/kxd/_kxd_autocomplete.ps1 + New-Item -ItemType File -Path ~/.kxd -Force + +uninstall: ## Uninstall Target + rm -Force -Recurse ${BINDIR}/kxd diff --git a/README.md b/README.md index 71b6a04..07f69a4 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,16 @@ Untested by the maintainers. `~/.kube/config` symlinks created on the Windows si `scripts/_kxd.ps1` and `scripts/_kxd_autocomplete.ps1` are PowerShell equivalents of the bash wrapper and autocomplete. +If you have `make` available on Windows, `Makefile_Windows` collapses steps 1–2 below into a single command: + +```powershell +make -f Makefile_Windows SHELL=pwsh.exe install +``` + +That builds `_kxd_prompt.exe` and drops both `.ps1` files into `C:\tools\kxd\` (override with `BINDIR=...`). You still need to add that directory to `$env:PATH` and dot-source the scripts from your `$PROFILE` (step 3 below). + +Otherwise, manual setup: + 1. Build the Windows binary and put it somewhere on `$env:PATH`: ```powershell $env:GOOS = "windows"; $env:GOARCH = "amd64"