#!/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] " exit 1 fi set -xe 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: $?"