mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
Fix syntax error when makellvm is run in an invalid directory.
Add debugging support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8389 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c6315d9b27
commit
ec6867e825
@ -6,6 +6,7 @@ alias usage 'echo "USAGE: $0:t [-h] [-n] [gmake-flag...] [VAR=...] [toolname (de
|
|||||||
|
|
||||||
set EXEC = opt
|
set EXEC = opt
|
||||||
set GMAKE_OPTS = ""
|
set GMAKE_OPTS = ""
|
||||||
|
set DEBUG = 0
|
||||||
|
|
||||||
set doit = 1
|
set doit = 1
|
||||||
unset options_done
|
unset options_done
|
||||||
@ -18,6 +19,8 @@ while ( !( $?options_done ) && ($#argv > 0))
|
|||||||
shift argv; set MFILE = $argv[1]; shift argv; breaksw
|
shift argv; set MFILE = $argv[1]; shift argv; breaksw
|
||||||
case -n :
|
case -n :
|
||||||
set doit = 0; shift argv; breaksw
|
set doit = 0; shift argv; breaksw
|
||||||
|
case -d :
|
||||||
|
set doit = 0; set DEBUG = 1; shift argv; breaksw
|
||||||
case -* :
|
case -* :
|
||||||
set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw
|
set GMAKE_OPTS = ( $GMAKE_OPTS $argv[1] ); shift argv; breaksw
|
||||||
default :
|
default :
|
||||||
@ -39,6 +42,9 @@ endif
|
|||||||
if ($#argv > 0) then
|
if ($#argv > 0) then
|
||||||
set EXEC = $argv[1]
|
set EXEC = $argv[1]
|
||||||
endif
|
endif
|
||||||
|
if ($DEBUG) then
|
||||||
|
echo "DEBUG: EXEC = $EXEC"
|
||||||
|
endif
|
||||||
|
|
||||||
## Compute LLVMDIR: the root of the current LLVM tree.
|
## Compute LLVMDIR: the root of the current LLVM tree.
|
||||||
## It is recorded in the variable LEVEL in Makefile, to compute it
|
## It is recorded in the variable LEVEL in Makefile, to compute it
|
||||||
@ -52,15 +58,22 @@ if (! $?MFILE) then
|
|||||||
set MFILE = Makefile
|
set MFILE = Makefile
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
if ($DEBUG) then
|
||||||
|
echo "DEBUG: MFILE = $MFILE"
|
||||||
|
endif
|
||||||
if (! -f $MFILE) then
|
if (! -f $MFILE) then
|
||||||
echo "Missing or invalid makefile: $MFILE"
|
echo "Missing or invalid makefile: $MFILE"
|
||||||
exit 1
|
exit 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
set LLVMDIR = `awk '/LEVEL[ ]*=/ {print $NF}' $MFILE`
|
set LLVMDIR = `awk '/LEVEL[ ]*=/ {print $NF}' $MFILE`
|
||||||
|
if ($DEBUG) then
|
||||||
|
echo "DEBUG: LLVMDIR = $LLVMDIR"
|
||||||
|
endif
|
||||||
|
|
||||||
if ($?LLVMDIR == 0 || ! -d $LLVMDIR) then
|
if ($#LLVMDIR == 0 || ! -d "$LLVMDIR") then
|
||||||
echo "Unable to find LEVEL or LEVEL is invalid ($LEVEL)"
|
echo "Unable to find LLVM obj-root directory or directory is invalid."
|
||||||
|
echo "Are you within a valid LLVM directory for running gmake?"
|
||||||
exit 1
|
exit 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user