Consolidate build into one root Makefile; split run.sh into run-engine.sh/run-interpreter.sh
This commit is contained in:
+17
-12
@@ -33,10 +33,11 @@ know before changing the engine. This document is the visual overview.
|
||||
- **`engine/i18n/`** holds the translation source files (`en.lang`,
|
||||
`de.lang`, ...), one `key=value` file per language — see
|
||||
[`CLAUDE.md`](../CLAUDE.md) for the key-naming convention.
|
||||
- **`dist/`** is generated by `make`: the `deck-engine` binary, a copy of
|
||||
the card art under `img/`, a copy of the translation files under
|
||||
`i18n/`, `run.sh`, and a `user.properties` template that's seeded once
|
||||
and never overwritten by later builds.
|
||||
- **`dist/`** is generated by the single root `Makefile`: the
|
||||
`deck-engine` and `interpreter-cli` binaries, a copy of the card art
|
||||
under `img/`, a copy of the translation files under `i18n/`,
|
||||
`run-engine.sh`/`run-interpreter.sh`, and a `user.properties` template
|
||||
that's seeded once and never overwritten by later builds.
|
||||
- **The Pebble watchapp does not exist yet.** When it's built, it will
|
||||
call `reading_generate()` directly and walk the returned struct to lay
|
||||
out its own screens — it has no reason to touch `reading_print_*`.
|
||||
@@ -70,15 +71,19 @@ Every display string produced along the way (`tarot_data.c`'s card and
|
||||
position text, `astro.c`'s body/sign/moon-phase/aspect names, and
|
||||
`reading.c`'s section headers) is looked up in `i18n.c`'s translation
|
||||
catalog, with the built-in English text as the fallback. `main.c` loads
|
||||
the catalog from `--lang`/`--i18n-dir` (or `run.sh`'s `lang=` property)
|
||||
before calling `reading_generate`, so this is orthogonal to the three
|
||||
computations above — it only affects how their results are rendered as
|
||||
text, not the underlying `TarotCard`/`ZodiacSign`/etc. enum values.
|
||||
the catalog from `--lang`/`--i18n-dir` (or `run-engine.sh`'s `lang=`
|
||||
property) before calling `reading_generate`, so this is orthogonal to
|
||||
the three computations above — it only affects how their results are
|
||||
rendered as text, not the underlying `TarotCard`/`ZodiacSign`/etc. enum
|
||||
values.
|
||||
|
||||
Both entry points (direct CLI flags, or `run.sh` pulling the seed/date
|
||||
from the OS clock and birth data from `user.properties`) converge on the
|
||||
same `main.c` argument parsing before calling `reading_generate` — there
|
||||
is exactly one code path from parsed input to a reading.
|
||||
Both entry points (direct CLI flags, or `run-engine.sh` pulling the
|
||||
seed/date from the OS clock and birth data from `user.properties`)
|
||||
converge on the same `main.c` argument parsing before calling
|
||||
`reading_generate` — there is exactly one code path from parsed input to
|
||||
a reading. `run-interpreter.sh` reuses those same OS-clock/`user.properties`
|
||||
inputs, but calls `deck-engine --format json` and pipes the result into
|
||||
`interpreter-cli` instead of printing a reading directly.
|
||||
|
||||
## Regenerating the diagrams
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Input & output formats
|
||||
|
||||
See [`architecture.md`](architecture.md) for how these fit together.
|
||||
There are two ways to provide input (direct CLI flags, or `run.sh` +
|
||||
`user.properties`) and three output formats (`text`, `html`, `json`); the
|
||||
There are two ways to provide input (direct CLI flags, or `run-engine.sh`
|
||||
+ `user.properties`) and three output formats (`text`, `html`, `json`); the
|
||||
`DailyReading` struct is the programmatic form all three are rendered
|
||||
from, and the one the future watchapp will consume directly. `json` is
|
||||
also `interpreter-cli`'s input format — see "The interpreter" at the
|
||||
@@ -34,9 +34,10 @@ deck-engine --seed <string> --birth-date YYYY-MM-DD --birth-time HH:MM
|
||||
Birth latitude/longitude only affect the Ascendant/houses — planet signs
|
||||
are geocentric and location-independent.
|
||||
|
||||
### `run.sh` + `user.properties`
|
||||
### `run-engine.sh` + `user.properties`
|
||||
|
||||
`dist/run.sh [text|html] [lang]` wraps the binary for daily use:
|
||||
`dist/run-engine.sh [text|html|json] [lang]` wraps the binary for daily
|
||||
use:
|
||||
|
||||
- **Seed and `--date`** come from the OS clock: `date +%Y-%m-%d` (stable
|
||||
all day) and `date -u +%Y-%m-%dT%H:%M`.
|
||||
@@ -55,12 +56,16 @@ are geocentric and location-independent.
|
||||
|
||||
The file is seeded once from `engine/scripts/user.properties.template`
|
||||
with placeholder values (`YOUR_BIRTH_DATE_HERE`, etc.) and is **never
|
||||
overwritten by later builds**. `run.sh` checks every birth field for an
|
||||
empty value or a leftover `YOUR_` placeholder and refuses to run with a
|
||||
clear error until the file is filled in; `lang` has no such check since
|
||||
it always has a usable default (`en`).
|
||||
overwritten by later builds**. `run-engine.sh` checks every birth field
|
||||
for an empty value or a leftover `YOUR_` placeholder and refuses to run
|
||||
with a clear error until the file is filled in; `lang` has no such
|
||||
check since it always has a usable default (`en`).
|
||||
- The optional second argument overrides `lang=` for a single run without
|
||||
editing the file, e.g. `dist/run.sh html de`.
|
||||
editing the file, e.g. `dist/run-engine.sh html de`.
|
||||
- `dist/run-interpreter.sh` (no arguments) is the equivalent wrapper for
|
||||
the interpreter: same OS clock + `user.properties` inputs, but calls
|
||||
`deck-engine --format json` and pipes it straight into
|
||||
`dist/interpreter-cli` — see "The interpreter" below.
|
||||
|
||||
### Translations (`--lang`, `dist/i18n/`)
|
||||
|
||||
@@ -226,6 +231,8 @@ dist/deck-engine ... --format json | dist/interpreter-cli
|
||||
# or:
|
||||
dist/deck-engine ... --format json > reading.json
|
||||
dist/interpreter-cli reading.json
|
||||
# or, for daily use (OS clock + user.properties, same inputs as run-engine.sh):
|
||||
dist/run-interpreter.sh
|
||||
```
|
||||
|
||||
- **Input**: a file path argument, or stdin if no argument (or `-`) is
|
||||
|
||||
Reference in New Issue
Block a user