aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-28 15:38:27 +0200
committeruser <user@clank>2026-08-28 15:38:27 +0200
commit67e0330e5f18e4fe7f87db978071c6afa77ee91b (patch)
tree73c544d533bead3c4f8cfdeff8c66de7b77df94a
parentwindows watcher: rebuild the watch set instead of freezing it (diff)
downloadslosh-67e0330e5f18e4fe7f87db978071c6afa77ee91b.tar.gz
slosh-67e0330e5f18e4fe7f87db978071c6afa77ee91b.tar.xz
slosh-67e0330e5f18e4fe7f87db978071c6afa77ee91b.zip
windows release: a zip in dist/, built beside the linux tarballs
make -f Makefile.windows dist stages slosh.exe as slosh-<version>-windows-<arch>.zip -- a zip, not a tarball, because Windows is the machine that will open it -- carrying the same licensing paperwork as the linux tarballs, with docs/windows.md riding along instead of the manpages. `make release` now builds both architectures via release-windows, so the windows zips land under the same SHA256SUMS as everything else.
-rw-r--r--Makefile21
-rw-r--r--Makefile.windows21
-rw-r--r--README.md4
-rw-r--r--docs/windows.md6
4 files changed, 43 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index df5d414..e9442e9 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@ endif
.PHONY: all clean vendor run test retest test-live test-all smoke help coverage \
docs www fmt fmt-check hooks tools install uninstall macos-dist \
- release release-linux
+ release release-linux release-windows
.DEFAULT_GOAL := help
help: ## show this
@@ -365,12 +365,13 @@ macos-dist: ## signed, notarized macOS build on the builder mac (REF=<tag> for a
$(Q)$(MAKE) -f Makefile.macos remote-dist REF=$(REF)
# ── releases ────────────────────────────────────────────────────────────────
-# Three binaries for a tagged release, staged in dist/ with a SHA256SUMS beside
-# them. The two linux ones are cross-built right here: zig cc is already the
-# compiler, so -target gets us x86_64 and aarch64 for free, statically linked
-# against musl so they run on any distro regardless of its libc. macOS is the
-# one that cannot be built here -- it must be signed and notarized on a mac --
-# so `release` hands that leg to `macos-dist`, which drives the builder.
+# Five artifacts for a tagged release, staged in dist/ with a SHA256SUMS beside
+# them. The two linux tarballs and the two windows zips are cross-built right
+# here: zig cc is already the compiler, so -target gets us x86_64 and aarch64
+# for free -- statically linked against musl for linux, and one slosh.exe with
+# no runtime dependency beyond the OS for windows (Makefile.windows). macOS is
+# the one that cannot be built here -- it must be signed and notarized on a mac
+# -- so `release` hands that leg to `macos-dist`, which drives the builder.
#
# VERSION comes from the git tag (contrib/version), so the usual flow is to
# check out the tag and run `make release REF=<tag>`: the linux tarballs are
@@ -415,7 +416,11 @@ release-linux: build/version.h build/logo.h ## cross-build the static linux tarb
printf ' %-5s %s\n' '[TAR]' "$(DIST)/$$stem.tar.gz"; \
done
-release: release-linux ## full release: linux tarballs + signed macOS zip + SHA256SUMS in dist/
+release-windows: ## cross-build the windows zips into dist/
+ $(Q)$(MAKE) --no-print-directory -f Makefile.windows ZIG=$(ZIG) ARCH=x86_64 dist
+ $(Q)$(MAKE) --no-print-directory -f Makefile.windows ZIG=$(ZIG) ARCH=aarch64 dist
+
+release: release-linux release-windows ## full release: linux tarballs + windows zips + signed macOS zip + SHA256SUMS in dist/
$(Q)$(MAKE) --no-print-directory macos-dist REF=$(REF)
$(Q)cd $(DIST) && { sha256sum slosh-$(VERSION)-* 2>/dev/null \
|| shasum -a 256 slosh-$(VERSION)-*; } > SHA256SUMS
diff --git a/Makefile.windows b/Makefile.windows
index 6a5e68f..adaff3a 100644
--- a/Makefile.windows
+++ b/Makefile.windows
@@ -21,6 +21,13 @@ VT_VERSION := $(shell sed -n 's/^[[:space:]]*\.version = "\([^"]*\)".*/\1/p' $(V
OUT := build/win-$(ARCH)
VERSION := $(shell contrib/version 2>/dev/null || cat VERSION)
+DIST ?= dist
+STEM := slosh-$(VERSION)-windows-$(ARCH)
+# The zip carries the same licensing paperwork as the linux tarballs
+# (libghostty-vt and stb_image are linked in -- see THIRD-PARTY-LICENSES).
+# The manpages are useless on Windows, so docs/windows.md rides along instead.
+REL_DOCS := README.md LICENSE THIRD-PARTY-LICENSES docs/windows.md
+
CFLAGS := -std=c23 -O1 -g -Wall -Wextra -Wno-unused-parameter -MMD -MP \
-Icompat/win -I$(VT_INC) -Iinclude -I$(OUT) \
-DGHOSTTY_STATIC \
@@ -41,7 +48,7 @@ else
say = @:
endif
-.PHONY: all clean vendor-win FORCE
+.PHONY: all dist clean vendor-win FORCE
.DEFAULT_GOAL := all
all: $(BIN)
@@ -87,6 +94,18 @@ $(OUT)/logo.h: logo.txt | $(OUT)
sed -e 's/\\\\/\\\\\\\\/g' -e 's/"/\\\\"/g' -e 's/^/ "/' -e 's/$$/",/' logo.txt; \
printf '};\n'; } > $@
+# The release artifact: the binary plus the paperwork, as a zip, because a
+# tarball is the wrong shape on the machine that will open it.
+dist: $(BIN)
+ @mkdir -p $(DIST)
+ @rm -rf "$(DIST)/$(STEM)" "$(DIST)/$(STEM).zip"
+ @mkdir -p "$(DIST)/$(STEM)"
+ @cp "$(BIN)" "$(DIST)/$(STEM)/slosh.exe"
+ @cp $(REL_DOCS) "$(DIST)/$(STEM)/"
+ @(cd $(DIST) && zip -qr "$(STEM).zip" "$(STEM)")
+ @rm -rf "$(DIST)/$(STEM)"
+ $(call say,[ZIP],$(DIST)/$(STEM).zip)
+
$(VT_LIB): vendor-win
vendor-win:
diff --git a/README.md b/README.md
index 8bc03de..0eec9bb 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,10 @@ Cross-compiled from a mac or a Linux box, then copied across:
make -f Makefile.windows ARCH=x86_64 # or ARCH=aarch64
```
+The binary lands at `build/win-<arch>/slosh.exe`; the `dist` target zips it
+with its licensing paperwork, and `make release` builds both architectures
+alongside the Linux and macOS artifacts.
+
## Run
```bash
diff --git a/docs/windows.md b/docs/windows.md
index 4d01a0d..c1901cd 100644
--- a/docs/windows.md
+++ b/docs/windows.md
@@ -17,6 +17,12 @@ architectures never share an output directory.
The binary appears at `build/win-<arch>/slosh.exe`; copy that to the Windows
machine.
+For a release, `make -f Makefile.windows ARCH=<arch> dist` stages the same
+build as `dist/slosh-<version>-windows-<arch>.zip` — the binary plus the same
+licensing paperwork the linux tarballs carry — and `make release` builds both
+architectures alongside the linux and macOS artifacts, covered by the same
+`SHA256SUMS`.
+
## What it does there
Everything the POSIX build does: panes, splits, tabs, detachable sessions, the