Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 1 | #!/bin/csh -f |
| 2 | |
Vikram S. Adve | 0731d54 | 2002-09-15 16:58:30 +0000 | [diff] [blame^] | 3 | ## LLVMDIR is simply the directory where this script resides! |
| 4 | set THISEXEC = $0 ## cannot use :h on $0 for some reason |
| 5 | set LLVMDIR = $THISEXEC:h |
Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 6 | set EXEC = opt |
| 7 | |
| 8 | if ($#argv > 0) then |
Vikram S. Adve | 0731d54 | 2002-09-15 16:58:30 +0000 | [diff] [blame^] | 9 | if (&& $argv[1] == "-h") then |
| 10 | echo 'USAGE: makellvm [toolname] (toolname defaults to "opt").' |
| 11 | exit 0 |
| 12 | endif |
| 13 | |
Vikram S. Adve | 631484c | 2002-09-15 16:33:32 +0000 | [diff] [blame] | 14 | set EXEC = NO_SUCH_TOOL |
| 15 | set TOOLS = `grep DIRS ${LLVMDIR}/tools/Makefile | sed 's/DIRS[ ]*=[ ]*//'` |
| 16 | foreach T ( $TOOLS ) |
| 17 | if ($argv[1] == "$T") then |
| 18 | set EXEC = $T |
| 19 | shift argv |
| 20 | break |
| 21 | endif |
| 22 | end |
| 23 | endif |
| 24 | |
| 25 | gnumake && (cd $LLVMDIR/tools/$EXEC && gnumake) |