interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / mk / 00-visor-core.mk

59 lines · 3410 bytes Raw Blame History
1# Omega Visor V1 (lead-owned). The `omega` binary is pure seeded OM-2 and
2# PHYSICS-FREE: it is compiled directly from $(OMEGA_OM_SRCS) by seed/out/omc.
3# Every Visor lane and its test is pure OM-2. The only Visor C left is what the
4# runtime-linked, test-only binaries link: visor_world.c (mk/visor-world.mk) and
5# visor_effect_request.c (mk/visor-authority.mk, test-effect-cap64).
6VISOR_CORE = omega_om_units omega_canonical omega_validate omega_core omega_codec aarch64_encoder aarch64_decoder \
7 omega_realize omega_realize_synth omega_machine omega_exec omega_verify omega_program omega_synthesis omega_library \
8 omega_vector omega_blackwell_qmd omega_blackwell_encoder omega_blackwell_realize
9VISOR_CORE_OBJS = $(addprefix $(OUT_DIR)/,$(addsuffix .o,$(VISOR_CORE)))
10VISOR_CFLAGS = -std=gnu11 -Wall -Wextra -Werror -MMD -MP -D_GNU_SOURCE -O2 -Isrc -Isrc/visor
11VISOR_SRCS = src/visor/visor_world.c src/visor/visor_effect_request.c
12VISOR_OBJS = $(patsubst src/visor/%.c,$(OUT_DIR)/visor/%.o,$(VISOR_SRCS))
13VISOR_DEPS = $(VISOR_OBJS:.o=.d)
14-include $(VISOR_DEPS)
15OMEGA_BIN = $(OUT_DIR)/omega
16# Seeded compiler for the pure OM-2 Visor lane tests.
17VISOR_OMC ?= seed/out/omc
18# Pure OM-2 units shared with the C bridge (om/units.sh); their `export fn` is a plain fn here.
19VISOR_OM_UNITS = om/aarch64/aarch64_om2.om om/visor/verify_om2.om om/visor/validate_om2.om
20# The language lane lowers fn definitions through visor_program.om, so it follows it.
21OMEGA_OM_SRCS = src/visor/visor.om $(VISOR_OM_UNITS) src/visor/visor_program.om \
22 src/language/omega_lex.om src/language/omega_parse.om src/language/omega_lower.om \
23 src/visor/visor_semantic.om src/visor/visor_machine.om \
24 src/visor/visor_realization.om \
25 src/visor/visor_verify.om src/visor/visor_evidence.om src/visor/visor_world.om \
26 src/visor/visor_effect_request.om src/visor/visor_parse_command.om src/visor/visor_console_hooks.om \
27 tools/omega_ops.om tools/omega_wire.om src/visor/visor_console.om tools/omega.om
28
29$(OUT_DIR)/visor $(OUT_DIR)/tests-visor $(OUT_DIR)/tests-language:
30 mkdir -p $@
31
32$(OUT_DIR)/visor/%.o: src/visor/%.c | $(OUT_DIR)/visor
33 $(CC) $(VISOR_CFLAGS) -c $< -o $@
34
35$(OMEGA_BIN): $(OMEGA_OM_SRCS) seed/out/omc | $(OUT_DIR)
36 (printf 'om2\n'; sed -e '/^om2$$/d' -e 's/^export fn /fn /' $(OMEGA_OM_SRCS)) | seed/out/omc > $@ && chmod +x $@
37
38.PHONY: omega
39omega: $(OMEGA_BIN)
40 cp $(OMEGA_BIN) ./omega
41
42$(OUT_DIR)/tests-language/%: tests/language/%.om seed/out/omc | $(OUT_DIR)/tests-language
43 seed/out/omc < $< > $@ && chmod +x $@
44
45# ---- aggregate Visor gates (lead-owned) --------------------------------------
46# Physics-free lane tests (no PHYSICS_DIR needed):
47.PHONY: test-visor-core visor-physics-free-check test-visor
48test-visor-core: test-visor-semantic test-language test-visor-verify test-visor-evidence \
49 test-visor-machine test-visor-realization test-visor-console visor-authority-check
50
51# Proves the omega binary builds without any physics checkout at all.
52visor-physics-free-check:
53 rm -rf $(OUT_DIR)/pf-check
54 $(MAKE) OUT_DIR=$(OUT_DIR)/pf-check PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0 $(OUT_DIR)/pf-check/omega
55 @echo OMEGA_VISOR_PHYSICS_FREE_BUILD_PASS
56
57# Full Visor suite: physics-free gates + the two runtime-linked hostile/world tests
58# (those need PHYSICS_DIR for omega_evidence.c's nvrm.h and VISOR_AUTH_CAP_LIB).
59test-visor: test-visor-core visor-physics-free-check test-visor-world test-visor-authority