-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
29 lines (24 loc) · 722 Bytes
/
build.sh
File metadata and controls
29 lines (24 loc) · 722 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
#!/bin/bash
# Build script for tiny-parser
# This script compiles the Haskell parser without needing LLVM
cd "$(dirname "$0")"
echo "Building tiny-parser..."
# Option 1: Use cabal with -O0 (no optimizations) to avoid LLVM
echo "Attempting to build with Cabal (no optimizations)..."
cabal build --ghc-options="-O0" 2>&1
if [ $? -eq 0 ]; then
echo ""
echo "✓ Build successful!"
echo ""
echo "To run the parser:"
echo " cabal run tiny-parser"
exit 0
fi
# Option 2: Fall back to runhaskell (interpreted)
echo ""
echo "⚠ Cabal build failed. Falling back to runhaskell (interpreted mode)..."
echo ""
echo "To run the parser interpreted:"
echo " runhaskell parser_standalone.hs"
echo ""
exit 1