forked from Elzawawy/java-bytecode-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·22 lines (21 loc) · 808 Bytes
/
run.sh
File metadata and controls
executable file
·22 lines (21 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/bash
# re-build program, (flex and Bison and G++ Tools).
make build_all
# Run executable with argument file.
# Supports debug mode with either tags (--debug or -d), in debug mode, simply files are taken from tests-cases directory.
if [ "$1" = "--debug" -o "$1" = "-d" ]; then
if [ -r "test-cases/$2" ]; then
./java_compiler.out "test-cases/$2"
make jasmin_run
else
echo "The argument '$2' is not a valid file, or does not exist in test-cases directory. Are you sure you want debug mode ?"
fi
# For non-debug mode, files are taken from anywhere and you include the filename directly after command.
else
if [ -r "$1" ]; then
./java_compiler.out "$1"
make jasmin_run
else
echo "The argument '$1' is not a valid file, or does not exist."
fi
fi