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 / allen.mk

68 lines · 3834 bytes Raw Blame History
1# ALLEN v0 (ARCH-0035 PROPOSED, OS-0018 PROPOSED): the durable subject inside
2# the AIEN organism. Picked up by `-include mk/*.mk`. New files only:
3# src/allen/allen_bind.{c,h}, tools/allen.c, tests/allen/run.sh, spec/allen.md.
4# Nothing here touches src/runtime; rx_aien.o is the same object R11 links.
5#
6# The subject object codec is the Aienux one (native/kernel/svc/
7# continuity_subject.c at aienos.lock), compiled here from $(AIENOS_R7_DIR):
8# omega never redefines the format. The default extraction (Makefile, R7) only
9# takes native/capability, so $(ALLEN_STAMP) extends it with the four trees
10# the codec needs.
11#
12# mk/*.mk is read before the Makefile defines OUT_DIR-derived R7 variables
13# (AIENOS_R7_DIR, AIENOS_LOCK, RX_AIEN_OBJ, AIENOS_CAP_LIB), so every
14# prerequisite that depends on them is written $$(...) and expanded in the
15# second phase (as polyglot.mk does). Recipes expand late anyway.
16#
17# test-allen: tests/allen/run.sh runs gates G1..G6 (identity, restart,
18# memory, model independence, no authority / no loop, negative control) plus
19# the refusals (unknown version, corruption, replay, supersession, subject
20# mismatch, model mismatch tolerance) and writes nothing outside $(ALLEN_DIR).
21.PHONY: test-allen allen
22.SECONDEXPANSION:
23ALLEN_DIR = $(OUT_DIR)/allen
24ALLEN_TOOL = $(ALLEN_DIR)/allen
25ALLEN_BIND_OBJ = $(ALLEN_DIR)/allen_bind.o
26ALLEN_MAIN_OBJ = $(ALLEN_DIR)/allen.o
27ALLEN_STAMP = $(ALLEN_DIR)/aienos-tree.stamp
28ALLEN_AIENOS_SVC = $(AIENOS_R7_DIR)/native/kernel/svc
29# kernel/core is -idirafter: it holds a sched.h that must not shadow <sched.h>.
30ALLEN_AIENOS_INC = -I$(ALLEN_AIENOS_SVC) -idirafter $(AIENOS_R7_DIR)/native/kernel/core \
31 -I$(AIENOS_R7_DIR)/native/argus -I$(AIENOS_R7_DIR)/native/store
32# One sha256: omega's src/omega_om_units.c (same ctx layout and names as native/argus).
33ALLEN_AIENOS_SRCS = $(ALLEN_AIENOS_SVC)/continuity_subject.c $(ALLEN_AIENOS_SVC)/continuity_codec.c \
34 $(AIENOS_R7_DIR)/native/store/store_v1.c
35ALLEN_RX_SRCS = src/runtime/rx_caproot.c src/runtime/rx_world.c src/runtime/rx_coherent.c \
36 src/runtime/rx_native_bind.c src/runtime/rx_cortex.c src/runtime/rx_cortex_record.c \
37 src/omega_om_units.c
38ALLEN_HDRS = src/allen/allen_bind.h src/runtime/rx_aien.h src/runtime/rx_world.h \
39 src/runtime/rx_cortex.h src/runtime/rx_cortex_record.h src/runtime/aienos_cap.h
40
41# The aienos trees the codec needs, at aienos.lock, proven like the $(AIENOS_CAP_LIB)
42# source (Makefile R7 block) on every build. The stamp records the lock and is rewritten
43# only when it changes, so a passing proof does not rebuild the objects.
44.PHONY: aienos-authority-allen
45aienos-authority-allen:
46 @$(call aienos_source,native/kernel/svc native/kernel/core native/argus native/store)
47
48$(ALLEN_STAMP): aienos.lock aienos-authority-allen
49 @mkdir -p $(ALLEN_DIR)
50 @test -f "$(ALLEN_AIENOS_SVC)/continuity_subject.h" || { \
51 echo "AIENOS_R7_DIR=$(AIENOS_R7_DIR) has no native/kernel/svc/continuity_subject.h (aienos.lock too old?)"; exit 1; }
52 @echo '$(AIENOS_LOCK)' | cmp -s - $@ || echo '$(AIENOS_LOCK)' > $@
53
54$(ALLEN_BIND_OBJ): src/allen/allen_bind.c $(ALLEN_HDRS) $(ALLEN_STAMP)
55 $(CC) $(CFLAGS) $(ALLEN_AIENOS_INC) -c -o $@ src/allen/allen_bind.c
56
57$(ALLEN_MAIN_OBJ): tools/allen.c $(ALLEN_HDRS) src/runtime/rx_omega.h $(ALLEN_STAMP)
58 $(CC) $(CFLAGS) $(ALLEN_AIENOS_INC) -c -o $@ tools/allen.c
59
60$(ALLEN_TOOL): $(ALLEN_MAIN_OBJ) $(ALLEN_BIND_OBJ) $$(RX_AIEN_OBJ) $(ALLEN_RX_SRCS) $$(ALLEN_AIENOS_SRCS) $$(AIENOS_CAP_LIB) $(ALLEN_STAMP)
61 $(CC) $(CFLAGS) $(ALLEN_AIENOS_INC) -pthread -o $@ $(ALLEN_MAIN_OBJ) $(ALLEN_BIND_OBJ) $(RX_AIEN_OBJ) \
62 $(ALLEN_RX_SRCS) $(ALLEN_AIENOS_SRCS) $(AIENOS_CAP_LIB) -lm
63
64allen: $(ALLEN_TOOL)
65
66test-allen: $(ALLEN_TOOL)
67 ALLEN_TOOL=$(ALLEN_TOOL) ALLEN_BIND_OBJ=$(ALLEN_BIND_OBJ) ALLEN_MAIN_OBJ=$(ALLEN_MAIN_OBJ) \
68 ALLEN_OUT=$(ALLEN_DIR)/run sh tests/allen/run.sh