Add a make package target for versioned Linux CLI release tarballs

Bundles deck-engine, interpreter-cli, run-engine.sh/run-interpreter.sh,
img/, i18n/, LICENSE, README.md, and docs/reading.md into
dist/deck-in-a-dash-<version>-linux-<arch>.tar.gz. Version defaults to
the current git tag (vX.Y.Z), falling back to a 0.0.0-dev+<sha>
placeholder when untagged
This commit is contained in:
ml
2026-07-11 20:12:50 +02:00
parent 1662d550c7
commit e522b4d6f5
3 changed files with 87 additions and 4 deletions
+35 -2
View File
@@ -19,6 +19,7 @@ make # builds dist/{deck-engine,interpreter-cli}, dist/img/, dist/i18n/
# dist/run-engine.sh, dist/run-interpreter.sh, dist/user.properties
make test # builds and runs engine/tests/smoke_test.c and interpreter/tests/*_test.c
make clean # removes build/ and the generated binaries/img/i18n (never touches dist/user.properties)
make package # builds a versioned Linux CLI tarball at dist/ - see "Packaging" below
```
A single `Makefile` at the repo root builds both `engine/` and
@@ -63,6 +64,36 @@ Run a single smoke test by editing `engine/tests/smoke_test.c`'s `main()`
temporarily, or just read its assertions — there's no test filter flag,
the whole suite runs in milliseconds.
## Packaging
`make package` (a `Makefile` target, not a separate script) builds a
fresh `all` and bundles it into a versioned, self-contained Linux CLI
tarball at `dist/deck-in-a-dash-<version>-linux-<arch>.tar.gz` -
`deck-engine`, `interpreter-cli`, `run-engine.sh`/`run-interpreter.sh`,
`img/`, `i18n/`, `LICENSE`, `README.md`, `docs/reading.md` (renamed
`READING.md`), and a placeholder `user.properties` (from
`engine/scripts/user.properties.template`, **never**
`dist/user.properties` itself - see below). Extracting the tarball
anywhere and running the scripts/binaries from inside it works exactly
like running them from `dist/` in place, since `run-engine.sh`/
`run-interpreter.sh` already resolve every path relative to their own
location (`SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"`), not the
caller's working directory.
**Version**: defaults to the current commit's git tag, matching
`vX.Y.Z` (the `v` is stripped); if `HEAD` isn't exactly on such a tag,
it falls back to a `0.0.0-dev+<short-sha>` placeholder with a warning on
stderr. Override either with `make package VERSION=1.2.3`. Push a
`vX.Y.Z` tag to drive a real release version.
**Never packages `dist/user.properties`**: the staging step copies
files into the package by explicit name only - never a wildcard or
recursive copy of `dist/` itself - specifically so a filled-in
`dist/user.properties` (real birth data, gitignored, private) can never
end up in a distributable package. The package always gets the
placeholder template instead, identical to what a first-time `make`
seeds `dist/user.properties` with.
## Architecture
```
@@ -91,8 +122,10 @@ deck_in_a_dash/
tests/smoke_test.c
scripts/run-engine.sh, scripts/run-interpreter.sh, scripts/user.properties.template
interpreter/ Separate module + binary; see "Interpretation" below.
dist/ Build output (gitignored-style; see Build & run).
Makefile Single root Makefile, builds both engine/ and interpreter/.
dist/ Build output (gitignored-style; see Build & run) and,
after `make package`, versioned release tarballs.
Makefile Single root Makefile, builds both engine/ and
interpreter/, and packages a release (see Packaging).
```
### Data flow / the real API