aboutsummaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-01-30 02:18:57 -0500
committerMustafa Quraish <[email protected]>2022-01-30 18:04:13 -0500
commitfe1febfc4b68c0494790d915c6247d98ed2205e9 (patch)
tree3aa68d57f7a9df9963aadcda351fb41a1b08162e /run.sh
parentRename `cup` directory to `src` (diff)
downloadcup-fe1febfc4b68c0494790d915c6247d98ed2205e9.tar.xz
cup-fe1febfc4b68c0494790d915c6247d98ed2205e9.zip
Update build system to use Makefile
`make` to compile the compiler `make XXX.out` to assemble/link `XXX.nasm` into an executable `make test` to run all tests `make tests/XXX` to run `tests/XXX.sh` test file `./run.sh <cupcc args>` to build, compile, run and show exit code
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/run.sh b/run.sh
index 6038d91..19360df 100755
--- a/run.sh
+++ b/run.sh
@@ -1,18 +1,25 @@
#!/bin/bash
+# This script does the following:
+# 1. Builds the project
+# 2. Compiles selected file
+# 3. Assembles executable from compiled asm
+# 4. Runs the executable
+# 5. Echoes the output of the executable
+
if [ -z "$1" ]
then
- echo "Usage: $0 <path to .cup file>"
+ echo "Usage: $0 <arguments to cupcc>"
exit 1
fi
set -xe
-./compile.sh
-./cupcc "$@"
-./assemble.sh output.nasm
+make
+build/cupcc "$@"
+make build/output.out
set +e
-./a.out
+build/output.out
echo "Exit status: $?" \ No newline at end of file