build.sh: Use shell built-in command trace
Rather than issuing echo "cmd..." then cmd... itself, we enable shell trace facility via set -x, which is POSIX shell standard command and is compatible with all UNIX shells. This effectively cuts build.sh size twice, since we don't need to double stuff there, also making it human readable. We are also setting PS4 (trace prefix) to none, instead final echo "SUCCESS", we issue : SUCCESS command which outputs its contents in trace.
This commit is contained in:
parent
8e4b5e10ba
commit
1608bd99eb
1 changed files with 3 additions and 3 deletions
|
|
@ -31,6 +31,7 @@ CC="gcc"
|
||||||
LINKER="gcc"
|
LINKER="gcc"
|
||||||
COMP_FLAGS="?{c.ccompiler.flags}$extraBuildArgs"
|
COMP_FLAGS="?{c.ccompiler.flags}$extraBuildArgs"
|
||||||
LINK_FLAGS="?{c.linker.flags}"
|
LINK_FLAGS="?{c.linker.flags}"
|
||||||
|
PS4=""
|
||||||
# add(result, "# platform detection\n")
|
# add(result, "# platform detection\n")
|
||||||
ucpu=`uname -m`
|
ucpu=`uname -m`
|
||||||
uos=`uname`
|
uos=`uname`
|
||||||
|
|
@ -131,14 +132,13 @@ case $myos in
|
||||||
case $mycpu in
|
case $mycpu in
|
||||||
# for cpuA in 1..c.cpus.len:
|
# for cpuA in 1..c.cpus.len:
|
||||||
?{c.cpus[cpuA-1]})
|
?{c.cpus[cpuA-1]})
|
||||||
|
set -x
|
||||||
# var linkCmd = ""
|
# var linkCmd = ""
|
||||||
# for ff in items(c.cfiles[osA][cpuA]):
|
# for ff in items(c.cfiles[osA][cpuA]):
|
||||||
# let f = ff.toUnix
|
# let f = ff.toUnix
|
||||||
echo "$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}"
|
|
||||||
$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
|
$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||||
# add(linkCmd, " \\\n" & changeFileExt(f, "o"))
|
# add(linkCmd, " \\\n" & changeFileExt(f, "o"))
|
||||||
# end for
|
# end for
|
||||||
echo "$LINKER -o ?{"$binDir/" & toLower(c.name)} ?linkCmd $LINK_FLAGS"
|
|
||||||
$LINKER -o ?{"$binDir/" & toLower(c.name)} ?linkCmd $LINK_FLAGS
|
$LINKER -o ?{"$binDir/" & toLower(c.name)} ?linkCmd $LINK_FLAGS
|
||||||
;;
|
;;
|
||||||
# end for
|
# end for
|
||||||
|
|
@ -155,4 +155,4 @@ case $myos in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "SUCCESS"
|
: SUCCESS
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue