-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·73 lines (61 loc) · 2.6 KB
/
build.sh
File metadata and controls
executable file
·73 lines (61 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# build.sh - Build and verify OMNIcode standalone executable
set -e
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ OMNIcode Standalone Executable Builder ║"
echo "║ Rust Native Compiler ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo
# Check for Rust
if ! command -v cargo &> /dev/null; then
echo "❌ Error: Rust not found. Install from https://rustup.rs/"
exit 1
fi
echo "✅ Rust toolchain found:"
rustc --version
echo
# Build
echo "📦 Building OMNIcode standalone (release mode)..."
echo " This may take 4-5 seconds on first build..."
echo
cd "$(dirname "$0")" || exit 1
cargo build --release
# Copy binary
echo
echo "✅ Build complete!"
echo
# standalone.omc is a symlink to target/release/omnimcode-standalone — refresh if missing
if [ ! -L standalone.omc ] || [ ! -e standalone.omc ]; then
rm -f standalone.omc
ln -s target/release/omnimcode-standalone standalone.omc
fi
echo "📋 Binary details:"
ls -lh standalone.omc
file -L standalone.omc
echo
# Run tests
echo "🧪 Running test suite..."
echo
test_count=0
pass_count=0
for test_file in examples/*.omc; do
test_count=$((test_count + 1))
echo " Test $test_count: $(basename "$test_file")..."
if ./standalone.omc "$test_file" > /dev/null 2>&1; then
echo " ✅ PASS"
pass_count=$((pass_count + 1))
else
echo " ❌ FAIL"
fi
done
echo
echo "╔════════════════════════════════════════════════════════════════╗"
if [ $pass_count -eq $test_count ]; then
echo "║ ✅ ALL TESTS PASSED ($pass_count/$test_count) ║"
else
echo "║ ⚠️ SOME TESTS FAILED ($pass_count/$test_count) ║"
fi
echo "║ ║"
echo "║ Ready to use: ./standalone.omc <program.omc> ║"
echo "║ Or start REPL: ./standalone.omc ║"
echo "╚════════════════════════════════════════════════════════════════╝"