Use much better method to find the llvmbase directory.
authorVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 15 Sep 2002 16:58:30 +0000 (16:58 +0000)
committerVikram S. Adve <vadve@cs.uiuc.edu>
Sun, 15 Sep 2002 16:58:30 +0000 (16:58 +0000)
Also, add -h option to print usage information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3729 91177308-0d34-0410-b5e6-96231b3b80d8

makellvm
utils/makellvm

index b61a99ad3629ba5073d3c2410d0d0acaeef6109e..8924012203b22f6cd02510d110ce4cad872401dd 100755 (executable)
--- 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 )
index b61a99ad3629ba5073d3c2410d0d0acaeef6109e..8924012203b22f6cd02510d110ce4cad872401dd 100755 (executable)
@@ -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 )