Stand up the foundation every later step depends on: - Source layout: src/, src/infra/, tests/, examples/ (.gitkeep markers). - Makefile: `build` compiles the smoke program via $SX, `test` runs the runner over tests/**/*.sx, `publish-example` placeholder (real in P3.4). Compiler located via `SX ?= /Users/agra/projects/sx/zig-out/bin/sx`. - tests/run.sh: POSIX-sh runner; discovers tests/**/*.sx, runs each via `$SX run`, prints ok/FAIL, exits 0 only when all pass (errors on zero tests so the gate is never silently empty). - tests/smoke.sx: passing smoke test importing modules/std.sx — proves toolchain wiring end-to-end (std resolves via the binary's own location). - .gitignore: ignore build/ artifacts.
30 lines
872 B
Makefile
30 lines
872 B
Makefile
# distribution — build/test gate.
|
|
#
|
|
# The sx compiler lives in a separate repo; locate it via SX (overridable):
|
|
# make build SX=/path/to/sx
|
|
SX ?= /Users/agra/projects/sx/zig-out/bin/sx
|
|
|
|
BUILD_DIR := build
|
|
|
|
# Programs compiled by `make build`. Currently just the smoke program;
|
|
# product entry points under src/ get added here as they land (P1.2+).
|
|
SMOKE := tests/smoke.sx
|
|
|
|
.PHONY: build test publish-example clean
|
|
|
|
# Compile the smoke program (and, later, product sources) without running.
|
|
build:
|
|
@mkdir -p $(BUILD_DIR)
|
|
$(SX) build -o $(BUILD_DIR)/smoke $(SMOKE)
|
|
|
|
# Run the test runner over every tests/**/*.sx. Exits non-zero on any failure.
|
|
test:
|
|
@SX="$(SX)" ./tests/run.sh
|
|
|
|
# Placeholder for the end-to-end publish flow — becomes real in P3.4.
|
|
publish-example:
|
|
@echo "publish-example: not implemented yet (becomes real in P3.4)"
|
|
|
|
clean:
|
|
@rm -rf $(BUILD_DIR)
|