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

56 lines · 2384 bytes Raw Blame History
1# POLYGLOT-0 build and test targets (pure seeded OM-2). spec/polyglot-0.md
2#
3# Targets:
4# test-polyglot pure OM-2 shared verifier + bench_polyglot --selftest
5# bench-polyglot timed benchmark writing receipts to $(POLYGLOT_EVIDENCE)
6# bench-polyglot-smoke smoke run (N=3) writing receipts to $(OUT_DIR)/polyglot/smoke
7# polyglot-explain deterministic explainer over $(POLYGLOT_RECEIPTS), run twice and cmp'd
8ifndef POLYGLOT_MK_LOADED
9POLYGLOT_MK_LOADED := 1
10
11.PHONY: test-polyglot bench-polyglot bench-polyglot-smoke polyglot-explain
12
13PG_OMC ?= seed/out/omc
14PG_OUT := $(OUT_DIR)/polyglot
15POLYGLOT_EVIDENCE ?= evidence/POLYGLOT
16POLYGLOT_RECEIPTS ?= $(POLYGLOT_EVIDENCE)
17POLYGLOT_BENCH_ARGS ?=
18POLYGLOT_RUN ?=
19
20PG_COMMON_OM := src/polyglot/omx_common.om
21PG_VERIFY := $(PG_OUT)/verify_polyglot
22PG_BENCH := $(PG_OUT)/bench_polyglot
23PG_EXPLAIN := $(PG_OUT)/polyglot_explain
24
25$(PG_VERIFY): $(PG_COMMON_OM) tests/polyglot/verify_polyglot.om
26 @mkdir -p $(dir $@)
27 cat $(PG_COMMON_OM) tests/polyglot/verify_polyglot.om | $(PG_OMC) > $@ && chmod +x $@
28
29$(PG_BENCH): $(PG_COMMON_OM) tests/polyglot/bench_polyglot.om
30 @mkdir -p $(dir $@)
31 cat $(PG_COMMON_OM) tests/polyglot/bench_polyglot.om | $(PG_OMC) > $@ && chmod +x $@
32
33$(PG_EXPLAIN): $(PG_COMMON_OM) tests/polyglot/polyglot_explain.om
34 @mkdir -p $(dir $@)
35 cat $(PG_COMMON_OM) tests/polyglot/polyglot_explain.om | $(PG_OMC) > $@ && chmod +x $@
36
37test-polyglot: $(PG_VERIFY) $(PG_BENCH)
38 ./$(PG_VERIFY)
39 ./$(PG_BENCH) --selftest
40
41bench-polyglot: $(PG_BENCH)
42 @mkdir -p $(POLYGLOT_EVIDENCE)
43 ./$(PG_BENCH) --spec spec/polyglot-0.md --out $(POLYGLOT_EVIDENCE) $(POLYGLOT_BENCH_ARGS)
44
45bench-polyglot-smoke: $(PG_BENCH)
46 @mkdir -p $(PG_OUT)/smoke
47 ./$(PG_BENCH) --spec spec/polyglot-0.md --out $(PG_OUT)/smoke --smoke --samples 3 $(POLYGLOT_BENCH_ARGS)
48
49polyglot-explain: $(PG_EXPLAIN)
50 ./$(PG_EXPLAIN) --spec spec/polyglot-0.md --receipts $(POLYGLOT_RECEIPTS) $(if $(POLYGLOT_RUN),--run $(POLYGLOT_RUN)) > $(PG_OUT)/polyglot_explain.1.txt
51 ./$(PG_EXPLAIN) --spec spec/polyglot-0.md --receipts $(POLYGLOT_RECEIPTS) $(if $(POLYGLOT_RUN),--run $(POLYGLOT_RUN)) > $(PG_OUT)/polyglot_explain.2.txt
52 cmp $(PG_OUT)/polyglot_explain.1.txt $(PG_OUT)/polyglot_explain.2.txt
53 @cat $(PG_OUT)/polyglot_explain.1.txt
54 @echo "polyglot-explain: two runs byte-identical ($(PG_OUT)/polyglot_explain.1.txt)"
55
56endif # POLYGLOT_MK_LOADED