blob: 72317e600560e823522d8897859aad1d5e7d6832 (
plain) (
blame)
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
|
#!/bin/bash
# This script does the following:
# - Builds the compiler written in CUP with the C compile
# - Compiles the file specified through CLI with CUP compiler
# - Runs the executable
# - Echoes the output of the executable
if [ -z "$1" ]
then
echo "Usage: $0 [-r] <arguments to build/cup.out>"
exit 1
fi
set -e
build/cupcc compiler/main.cup -o build/cup.nasm
make build/cup.out -s
build/cup.out "$@"
make build/host.out -s
set +e
set -x
build/host.out
|