2002-09-15 16:33:32 +00:00
|
|
|
#!/bin/csh -f
|
|
|
|
|
2002-09-19 14:54:53 +00:00
|
|
|
set pstatus = 0
|
|
|
|
onintr cleanup
|
|
|
|
alias usage 'echo "USAGE: $0:t [-h] [-n] [gmake-flag...] [toolname]"; set pstatus = 1; goto cleanup'
|
|
|
|
|
2002-09-15 16:58:30 +00:00
|
|
|
## LLVMDIR is simply the directory where this script resides!
|
2002-09-18 23:22:27 +00:00
|
|
|
set thisExec = $0 ## cannot use :h on $0 for some reason
|
|
|
|
set LLVMDIR = `echo {$thisExec:h} | sed 's/\/utils$//'`
|
2002-09-15 16:33:32 +00:00
|
|
|
set EXEC = opt
|
2002-09-19 14:54:53 +00:00
|
|
|
set GMAKE_OPTS = ""
|
|
|
|
|
|
|
|
set doit = 1
|
|
|
|
unset options_done
|
|
|
|
while ( !( $?options_done ) && ($#argv > 0))
|
|
|
|
switch ($argv[1])
|
|
|
|
case -h :
|
|
|
|
usage
|
|
|
|
case -n :
|
|
|
|
set doit = 0; shift argv; breaksw
|
|
|
|
case -* :
|
|
|
|
set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw
|
|
|
|
default :
|
|
|
|
set options_done; breaksw
|
|
|
|
endsw
|
|
|
|
end
|
2002-09-15 16:33:32 +00:00
|
|
|
|
|
|
|
if ($#argv > 0) then
|
2002-09-15 18:22:47 +00:00
|
|
|
set EXEC = $argv[1]
|
2002-09-15 16:33:32 +00:00
|
|
|
endif
|
|
|
|
|
2002-09-19 14:54:53 +00:00
|
|
|
set CMD = "gmake $GMAKE_OPTS && (cd $LLVMDIR/tools/$EXEC && gmake $GMAKE_OPTS)"
|
|
|
|
|
|
|
|
if ($doit == 1) then
|
|
|
|
csh -f -c "$CMD"
|
|
|
|
else
|
|
|
|
echo '(NOT EXECUTING) COMMAND:'
|
|
|
|
echo " $CMD"
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
#=========================================================
|
|
|
|
# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
|
|
|
|
#=========================================================
|
|
|
|
cleanup:
|
|
|
|
exit($pstatus)
|