Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/tests/import/omcbuild.sh # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / tests / import / omcbuild.sh` 18 lines ยท 724 bytes Raw Blame History 1 #!/bin/sh 2 # omcbuild.sh OUTBIN SRC.om... : concatenate sources as one OM-2 unit (the server build prepends 3 # `om2` too) and compile with the pinned omc. Fails unless compile rc is 0 and stderr is empty. 4 set -u 5 OMC=$(sh "$(dirname "$0")/../../tools/omc.sh") || exit 1 6 out=$1; shift 7 unit="$out.unit.om" 8 { echo om2; cat "$@"; } > "$unit" 9 rm -f "$out" 10 "$OMC" < "$unit" > "$out.tmp" 2> "$out.err" 11 rc=$? 12 if [ "$rc" -ne 0 ] || [ -s "$out.err" ]; then 13 echo "omcbuild: $out compile rc=$rc: $(cat "$out.err")" >&2 14 rm -f "$out.tmp" 15 exit 1 16 fi 17 mv "$out.tmp" "$out" && chmod +x "$out" 18 echo "omcbuild: $out ok sha256=$(sha256sum "$out" | cut -d' ' -f1) unit_sha256=$(sha256sum "$unit" | cut -d' ' -f1) fns=$(grep -c '^fn ' "$unit")"