-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·38 lines (31 loc) · 766 Bytes
/
demo.sh
File metadata and controls
executable file
·38 lines (31 loc) · 766 Bytes
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
#!/bin/bash
echo "======================================"
echo "SpecterCC Compiler Demonstration"
echo "======================================"
echo
cd "$(dirname "$0")"
if [ ! -f build/spectercc ]; then
echo "Building compiler..."
mkdir -p build
cd build
cmake ..
make -j$(nproc)
cd ..
echo
fi
for example in examples/*.spc; do
name=$(basename "$example" .spc)
echo "--- Compiling: $name ---"
echo "Source:"
cat "$example"
echo
echo "Compiling to executable..."
./build/spectercc "$example" -o "/tmp/$name"
echo "Executing..."
"/tmp/$name"
result=$?
echo "Program returned: $result"
echo "======================================"
echo
done
echo "Demonstration complete!"