Give the interpreter real Celtic Cross meanings and --format/--lang support
- guidance.c now prints last, after the full spread; both it and main.c's new Celtic Cross readout pull real Waite card meanings via tarot_data.c instead of just naming cards. - interpreter-cli gains --format text|html|json and --lang en|de, matching deck-engine - required linking engine/src/tarot_data.c and i18n.c into the interpreter binary (a narrow, documented exception to its earlier "no engine .c files" policy) and writing German translations for narrative.c's/guidance.c's own text.
This commit is contained in:
@@ -36,29 +36,45 @@ ENGINE_TEST_BINARY := $(BUILD_DIR)/smoke_test
|
||||
|
||||
# ---- interpreter ----
|
||||
|
||||
# Only ever compiles this module's own sources - significance.h/
|
||||
# reading_io.h reach into engine/src/ for struct/enum *definitions*
|
||||
# (plain #includes), but no engine/src/*.c (or the vendored Astronomy
|
||||
# Engine) is compiled or linked here. That's what keeps this module (and
|
||||
# its tests) independent of the engine's actual ephemeris/tarot-draw
|
||||
# Mostly compiles only this module's own sources - significance.h/
|
||||
# reading_io.h/narrative.h reach into engine/src/ for struct/enum
|
||||
# *definitions* (plain #includes) without linking any engine/src/*.c (or
|
||||
# the vendored Astronomy Engine). That's what keeps those modules (and
|
||||
# their tests) independent of the engine's actual ephemeris/tarot-draw
|
||||
# implementation - see significance.c's and reading_io.c's own comments
|
||||
# for why each duplicates a small table instead of linking astro.c.
|
||||
#
|
||||
# The one deliberate exception is engine/src/tarot_data.c (card/position
|
||||
# names and Waite meaning text) and its own i18n.c dependency: both are
|
||||
# pure, deterministic lookup tables with no ephemeris, no randomness, and
|
||||
# (since the interpreter never calls i18n_load) no file I/O either, so
|
||||
# linking them doesn't compromise interpreter/tests/'s "no real
|
||||
# ephemeris/tarot-draw call" independence - it just avoids duplicating
|
||||
# ~40 short strings of Waite's own card text a second time for
|
||||
# main.c's/guidance.c's full-spread readout. See CLAUDE.md.
|
||||
INTERP_SRC_DIR := interpreter/src
|
||||
INTERP_TEST_DIR := interpreter/tests
|
||||
|
||||
INTERP_LIB_SRCS := $(INTERP_SRC_DIR)/significance.c $(INTERP_SRC_DIR)/json.c \
|
||||
$(INTERP_SRC_DIR)/reading_io.c $(INTERP_SRC_DIR)/narrative.c
|
||||
$(INTERP_SRC_DIR)/reading_io.c $(INTERP_SRC_DIR)/narrative.c \
|
||||
$(INTERP_SRC_DIR)/guidance.c
|
||||
INTERP_LIB_OBJS := $(patsubst %.c,$(OBJ_DIR)/%.o,$(INTERP_LIB_SRCS))
|
||||
INTERP_MAIN_OBJ := $(OBJ_DIR)/$(INTERP_SRC_DIR)/main.o
|
||||
|
||||
# Shared with the engine build (same source, same flags - see the
|
||||
# comment above); reused as-is rather than compiled twice.
|
||||
INTERP_TAROT_TEXT_OBJS := $(OBJ_DIR)/$(ENGINE_SRC_DIR)/tarot_data.o $(OBJ_DIR)/$(ENGINE_SRC_DIR)/i18n.o
|
||||
|
||||
INTERP_BINARY := $(DIST_DIR)/interpreter-cli
|
||||
|
||||
SIGNIFICANCE_TEST_OBJ := $(OBJ_DIR)/$(INTERP_TEST_DIR)/significance_test.o
|
||||
JSON_TEST_OBJ := $(OBJ_DIR)/$(INTERP_TEST_DIR)/json_test.o
|
||||
NARRATIVE_TEST_OBJ := $(OBJ_DIR)/$(INTERP_TEST_DIR)/narrative_test.o
|
||||
GUIDANCE_TEST_OBJ := $(OBJ_DIR)/$(INTERP_TEST_DIR)/guidance_test.o
|
||||
SIGNIFICANCE_TEST_BIN := $(BUILD_DIR)/significance_test
|
||||
JSON_TEST_BIN := $(BUILD_DIR)/json_test
|
||||
NARRATIVE_TEST_BIN := $(BUILD_DIR)/narrative_test
|
||||
GUIDANCE_TEST_BIN := $(BUILD_DIR)/guidance_test
|
||||
|
||||
.PHONY: all test clean images i18n scripts
|
||||
|
||||
@@ -68,7 +84,7 @@ $(ENGINE_BINARY): $(ENGINE_OBJS) $(ENGINE_MAIN_OBJ)
|
||||
@mkdir -p $(DIST_DIR)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
$(INTERP_BINARY): $(INTERP_LIB_OBJS) $(INTERP_MAIN_OBJ)
|
||||
$(INTERP_BINARY): $(INTERP_LIB_OBJS) $(INTERP_MAIN_OBJ) $(INTERP_TAROT_TEXT_OBJS)
|
||||
@mkdir -p $(DIST_DIR)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
@@ -109,11 +125,12 @@ scripts:
|
||||
cp $(ENGINE_SCRIPTS_DIR)/user.properties.template $(DIST_DIR)/user.properties; \
|
||||
fi
|
||||
|
||||
test: $(ENGINE_TEST_BINARY) $(SIGNIFICANCE_TEST_BIN) $(JSON_TEST_BIN) $(NARRATIVE_TEST_BIN)
|
||||
test: $(ENGINE_TEST_BINARY) $(SIGNIFICANCE_TEST_BIN) $(JSON_TEST_BIN) $(NARRATIVE_TEST_BIN) $(GUIDANCE_TEST_BIN)
|
||||
./$(ENGINE_TEST_BINARY)
|
||||
./$(SIGNIFICANCE_TEST_BIN)
|
||||
./$(JSON_TEST_BIN)
|
||||
./$(NARRATIVE_TEST_BIN)
|
||||
./$(GUIDANCE_TEST_BIN)
|
||||
|
||||
$(ENGINE_TEST_BINARY): $(ENGINE_OBJS) $(ENGINE_TEST_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
@@ -124,7 +141,11 @@ $(SIGNIFICANCE_TEST_BIN): $(OBJ_DIR)/$(INTERP_SRC_DIR)/significance.o $(SIGNIFIC
|
||||
$(JSON_TEST_BIN): $(OBJ_DIR)/$(INTERP_SRC_DIR)/json.o $(OBJ_DIR)/$(INTERP_SRC_DIR)/reading_io.o $(JSON_TEST_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
$(NARRATIVE_TEST_BIN): $(OBJ_DIR)/$(INTERP_SRC_DIR)/narrative.o $(NARRATIVE_TEST_OBJ)
|
||||
$(NARRATIVE_TEST_BIN): $(OBJ_DIR)/$(INTERP_SRC_DIR)/narrative.o $(INTERP_TAROT_TEXT_OBJS) $(NARRATIVE_TEST_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
$(GUIDANCE_TEST_BIN): $(OBJ_DIR)/$(INTERP_SRC_DIR)/guidance.o $(OBJ_DIR)/$(INTERP_SRC_DIR)/significance.o \
|
||||
$(INTERP_TAROT_TEXT_OBJS) $(GUIDANCE_TEST_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
$(OBJ_DIR)/%.o: %.c
|
||||
|
||||
Reference in New Issue
Block a user