DISABLE FDs (REMOVE ME).
[jackhill/mal.git] / vhdl / run_vhdl.sh
1 #!/bin/bash
2
3 # ghdl doesn't allow passing command-line arguments to the VHDL program. To
4 # circumvent that, we write the command-line arguments as lines in
5 # vhdl_argv.tmp, and read the content of that file at the beginning of the VHDL
6 # program.
7
8 cleanup() {
9 trap - TERM QUIT INT EXIT
10 rm -f vhdl_argv.tmp
11 }
12 trap "cleanup" TERM QUIT INT EXIT
13
14 bin="$1"
15 shift
16
17 for arg in "$@" ; do
18 echo "$arg"
19 done > vhdl_argv.tmp
20
21 $bin