From 9b33ad41dc07cc922302eb99059d8e81a4afb537 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sun, 15 Sep 2002 16:58:30 +0000 Subject: [PATCH] Use much better method to find the llvmbase directory. Also, add -h option to print usage information. llvm-svn: 3729 --- makellvm | 9 ++++++++- utils/makellvm | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/makellvm b/makellvm index b61a99ad362..8924012203b 100755 --- a/makellvm +++ b/makellvm @@ -1,9 +1,16 @@ #!/bin/csh -f -set LLVMDIR = $HOME/llvm + ## LLVMDIR is simply the directory where this script resides! +set THISEXEC = $0 ## cannot use :h on $0 for some reason +set LLVMDIR = $THISEXEC:h set EXEC = opt if ($#argv > 0) then + if (&& $argv[1] == "-h") then + echo 'USAGE: makellvm [toolname] (toolname defaults to "opt").' + exit 0 + endif + set EXEC = NO_SUCH_TOOL set TOOLS = `grep DIRS ${LLVMDIR}/tools/Makefile | sed 's/DIRS[ ]*=[ ]*//'` foreach T ( $TOOLS ) diff --git a/utils/makellvm b/utils/makellvm index b61a99ad362..8924012203b 100755 --- a/utils/makellvm +++ b/utils/makellvm @@ -1,9 +1,16 @@ #!/bin/csh -f -set LLVMDIR = $HOME/llvm + ## LLVMDIR is simply the directory where this script resides! +set THISEXEC = $0 ## cannot use :h on $0 for some reason +set LLVMDIR = $THISEXEC:h set EXEC = opt if ($#argv > 0) then + if (&& $argv[1] == "-h") then + echo 'USAGE: makellvm [toolname] (toolname defaults to "opt").' + exit 0 + endif + set EXEC = NO_SUCH_TOOL set TOOLS = `grep DIRS ${LLVMDIR}/tools/Makefile | sed 's/DIRS[ ]*=[ ]*//'` foreach T ( $TOOLS )