diff options
| author | Mustafa Quraish <[email protected]> | 2022-01-30 02:18:57 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-01-30 18:04:13 -0500 |
| commit | fe1febfc4b68c0494790d915c6247d98ed2205e9 (patch) | |
| tree | 3aa68d57f7a9df9963aadcda351fb41a1b08162e /run.sh | |
| parent | Rename `cup` directory to `src` (diff) | |
| download | cup-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-x | run.sh | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -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 |