blob: 9c8eab486d6f7a033bd9ff50c42e03292ff80d7a [file] [log] [blame]
Vikram S. Adve631484c2002-09-15 16:33:32 +00001#!/bin/csh -f
2
Vikram S. Adve39c36e82002-09-19 14:54:53 +00003set pstatus = 0
4onintr cleanup
5alias usage 'echo "USAGE: $0:t [-h] [-n] [gmake-flag...] [toolname]"; set pstatus = 1; goto cleanup'
6
Vikram S. Adve0731d542002-09-15 16:58:30 +00007 ## LLVMDIR is simply the directory where this script resides!
Vikram S. Adved3448cd2002-09-18 23:22:27 +00008set thisExec = $0 ## cannot use :h on $0 for some reason
9set LLVMDIR = `echo {$thisExec:h} | sed 's/\/utils$//'`
Vikram S. Adve631484c2002-09-15 16:33:32 +000010set EXEC = opt
Vikram S. Adve39c36e82002-09-19 14:54:53 +000011set GMAKE_OPTS = ""
12
13set doit = 1
14unset options_done
15while ( !( $?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
26end
Vikram S. Adve631484c2002-09-15 16:33:32 +000027
28if ($#argv > 0) then
Vikram S. Adve2d456602002-09-15 18:22:47 +000029 set EXEC = $argv[1]
Vikram S. Adve631484c2002-09-15 16:33:32 +000030endif
31
Vikram S. Adve39c36e82002-09-19 14:54:53 +000032set CMD = "gmake $GMAKE_OPTS && (cd $LLVMDIR/tools/$EXEC && gmake $GMAKE_OPTS)"
33
34if ($doit == 1) then
35 csh -f -c "$CMD"
36else
37 echo '(NOT EXECUTING) COMMAND:'
38 echo " $CMD"
39endif
40
41
42#=========================================================
43# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
44#=========================================================
45cleanup:
46 exit($pstatus)