interplane.Get Omega
Read in your language

babel

aien-dev/babel

Brought by drakestapleton

branch main Branches Tags History

babel / build.sh

24 lines · 1221 bytes Raw Blame History
1#!/bin/sh
2# Build build/babel from src/*.om with the pinned OM-2 compiler.
3# usage: OMEGA_MV=<aien-dev/omega-mv clone> ./build.sh
4# Pins (aien-dev/omega-mv 0b77e6ea2, both Apache-2.0):
5# omc = seed/out/omc sha256 2c824805...029f
6# sha256 unit = om/sha256/sha256-om2.om sha256 dbf002dd...94bb (FIPS 180-4 SHA-256 in OM-2)
7set -eu
8: "${OMEGA_MV:?set OMEGA_MV to an aien-dev/omega-mv clone}"
9cd "$(dirname "$0")"
10mkdir -p build
11git -C "$OMEGA_MV" show 0b77e6ea2:seed/out/omc > build/omc
12git -C "$OMEGA_MV" show 0b77e6ea2:om/sha256/sha256-om2.om > build/sha256-om2.om
13sha256sum -c - <<EOF
142c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f build/omc
15dbf002dd6aa36585632b9d01d98ac3f0bd2fa0f0475082940de53638847994bb build/sha256-om2.om
16EOF
17chmod +x build/omc
18# sha256-om2.om carries the `om2` header line, so it goes first. Its four `export fn` entries are
19# library-mode markers, refused next to `fn main` (error 9); babel calls them as ordinary functions,
20# so the marker is dropped and nothing else in the unit changes.
21{ sed 's/^export fn /fn /' build/sha256-om2.om; cat src/*.om; } > build/babel.om
22build/omc < build/babel.om > build/babel
23chmod +x build/babel
24sha256sum build/babel