Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 1 | #!/bin/csh -f |
| 2 | |
Vikram S. Adve | 39c36e8 | 2002-09-19 14:54:53 +0000 | [diff] [blame] | 3 | set pstatus = 0 |
| 4 | onintr cleanup |
| 5 | alias usage 'echo "USAGE: $0:t [-h] [-n] [gmake-flag...] [toolname]"; set pstatus = 1; goto cleanup' |
| 6 | |
Vikram S. Adve | 0731d54 | 2002-09-15 16:58:30 +0000 | [diff] [blame] | 7 | ## LLVMDIR is simply the directory where this script resides! |
Vikram S. Adve | d3448cd | 2002-09-18 23:22:27 +0000 | [diff] [blame] | 8 | set thisExec = $0 ## cannot use :h on $0 for some reason |
| 9 | set LLVMDIR = `echo {$thisExec:h} | sed 's/\/utils$//'` |
Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 10 | set EXEC = opt |
Vikram S. Adve | 39c36e8 | 2002-09-19 14:54:53 +0000 | [diff] [blame] | 11 | set GMAKE_OPTS = "" |
| 12 | |
| 13 | set doit = 1 |
| 14 | unset options_done |
| 15 | while ( !( $?options_done ) && ($#argv > 0)) |
| 16 | switch ($argv[1]) |
| 17 | case -h : |
| 18 | usage |
| 19 | case -n : |
| 20 | set doit = 0; shift argv; breaksw |
| 21 | case -* : |
| 22 | set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw |
| 23 | default : |
| 24 | set options_done; breaksw |
| 25 | endsw |
| 26 | end |
Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 27 | |
| 28 | if ($#argv > 0) then |
Vikram S. Adve | 2d45660 | 2002-09-15 18:22:47 +0000 | [diff] [blame] | 29 | set EXEC = $argv[1] |
Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 30 | endif |
| 31 | |
Vikram S. Adve | 39c36e8 | 2002-09-19 14:54:53 +0000 | [diff] [blame] | 32 | set CMD = "gmake $GMAKE_OPTS && (cd $LLVMDIR/tools/$EXEC && gmake $GMAKE_OPTS)" |
| 33 | |
| 34 | if ($doit == 1) then |
| 35 | csh -f -c "$CMD" |
| 36 | else |
| 37 | echo '(NOT EXECUTING) COMMAND:' |
| 38 | echo " $CMD" |
| 39 | endif |
| 40 | |
| 41 | |
| 42 | #========================================================= |
| 43 | # CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED |
| 44 | #========================================================= |
| 45 | cleanup: |
| 46 | exit($pstatus) |