blob: 9259dd43f98f1f9123f82f2a38dbb73271116d1d (
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
27
28
|
#!/bin/bash
# This script does the following:
# 1. Builds compiler written in C first
# 2. Builds the compiler written in CUP with the C compiler
# 3. Compiles the file specified through CLI with CUP compiler
# 4. Runs the executable
# 5. Echoes the output of the executable
if [ -z "$1" ]
then
echo "Usage: $0 <arguments to build/cup.out>"
exit 1
fi
set -xe
make
build/cupcc compiler/main.cup -o build/cup.nasm
make build/cup.out
build/cup.out "$@"
make build/host.out
set +e
build/host.out
echo "Exit status: $?"
|