diff options
| -rwxr-xr-x | assemble.sh | 14 | ||||
| -rwxr-xr-x | compile.sh | 1 | ||||
| -rwxr-xr-x | test.sh | 18 |
3 files changed, 32 insertions, 1 deletions
diff --git a/assemble.sh b/assemble.sh new file mode 100755 index 0000000..90f945f --- /dev/null +++ b/assemble.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# NOTE: Only for macOS (intel) + +if [ -z "$1" ] +then + echo "Usage: $0 <path to nasm file>" + exit 1 +fi + +set -xe + +nasm -f macho64 -o $1.o $1 +ld -lSystem $1.o @@ -7,4 +7,3 @@ SRCS=cup/*.c set -xe $CC $CFLAGS $SRCS -o cupcc -./cupcc $@ @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ -z "$1" ] +then + echo "Usage: $0 <path to .cup file>" + exit 1 +fi + +set -xe + +./compile.sh +./cupcc $@ +./assemble.sh output.nasm + +set +e + +./a.out +echo "Exit status: $?"
\ No newline at end of file |