mirror of
https://github.com/jeremysrand/Apple2GSBuildPipeline.git
synced 2024-12-26 12:29:26 +00:00
Detect errors returned by the C compiler or the resource compiler and make them visible in Xcode.
This commit is contained in:
parent
2c37fcd120
commit
b883e09a18
BIN
make/.DS_Store
vendored
BIN
make/.DS_Store
vendored
Binary file not shown.
31
make/orca-cc
31
make/orca-cc
@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
TMPFILE=/tmp/orca-cc.$$
|
||||
STDOUTPUT=/tmp/orca-cc-std.$$
|
||||
ERROUTPUT=/tmp/orca-cc-errs.$$
|
||||
|
||||
FILENAME="$1"
|
||||
shift
|
||||
@ -28,14 +29,31 @@ DEPSNAME="${BASENAME}.d"
|
||||
OBJSNAME="${BASENAME}.a"
|
||||
ROOTNAME="${BASENAME}.root"
|
||||
|
||||
$ORCA --trace-gsos compile $COMPILEARGS "$FILENAME" keep="${BASENAME}" $CCARGS 2> $TMPFILE
|
||||
$ORCA --trace-gsos compile $COMPILEARGS "$FILENAME" keep="${BASENAME}" $CCARGS > $STDOUTPUT 2> $ERROUTPUT
|
||||
RESULT=$?
|
||||
|
||||
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2
|
||||
awk '
|
||||
{
|
||||
print $0
|
||||
}
|
||||
|
||||
$1 ~ /^[0-9][0-9]*$/ {
|
||||
LINENO=$1
|
||||
}
|
||||
|
||||
/^ *\^/ {
|
||||
sub(/^ *\^/, "", $0)
|
||||
printf("%s/%s:%d:0:%s\n", PWD, FILE, LINENO, $0)
|
||||
}
|
||||
' "PWD=`pwd`" "FILE=$FILENAME" $STDOUTPUT
|
||||
|
||||
|
||||
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $ERROUTPUT >&2
|
||||
|
||||
if [ "$RESULT" -ne 0 ]
|
||||
then
|
||||
rm -f $TMPFILE
|
||||
rm -f $ERROUTPUT
|
||||
rm -f $STDOUTPUT
|
||||
rm -f $OBJSNAME
|
||||
rm -f $ROOTNAME
|
||||
exit $RESULT
|
||||
@ -45,7 +63,7 @@ DEPS=`awk '
|
||||
/^FastFileLoad/ {
|
||||
sub(/^FastFileLoad\(/, "");
|
||||
sub(/\)$/, "");
|
||||
print}' $TMPFILE | sort -u | while read FILE
|
||||
print}' $ERROUTPUT | sort -u | while read FILE
|
||||
do
|
||||
if [ -f "$FILE" ]
|
||||
then
|
||||
@ -53,7 +71,8 @@ DEPS=`awk '
|
||||
fi
|
||||
done | tr '\012' ' '`
|
||||
|
||||
rm -f $TMPFILE
|
||||
rm -f $ERROUTPUT
|
||||
rm -f $STDOUTPUT
|
||||
|
||||
# We add a dependency for both the .o and the .root file. If this is the
|
||||
# main.c file being compiled, we need the dependency on the .root file.
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
TMPFILE=/tmp/orca-rez.$$
|
||||
ERROUTPUT=/tmp/orca-rez-err.$$
|
||||
|
||||
FILENAME="$1"
|
||||
shift
|
||||
@ -15,14 +15,29 @@ BASENAME=`echo $FILENAME | sed 's/\.rez$//'`
|
||||
DEPSNAME="${BASENAME}.rez.d"
|
||||
OBJSNAME="${BASENAME}.r"
|
||||
|
||||
$ORCA --trace-gsos compile $* keep="${OBJSNAME}" "$FILENAME" 2> $TMPFILE
|
||||
$ORCA --trace-gsos compile $* keep="${OBJSNAME}" "$FILENAME" 2> $ERROUTPUT
|
||||
RESULT=$?
|
||||
|
||||
sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2
|
||||
awk '
|
||||
/^[A-Za-z][A-Za-z]*\(.*\)$/ {
|
||||
next
|
||||
}
|
||||
|
||||
{
|
||||
print
|
||||
}
|
||||
|
||||
/^File [^ ]*; Line [0-9][0-9]*;/ {
|
||||
sub(/;/,"",$4)
|
||||
LINENO=$4
|
||||
sub(/^File [^ ]*; Line [0-9][0-9]*/, "", $0)
|
||||
printf("%s/%s:%d:0:%s\n", PWD, FILE, LINENO, $0)
|
||||
}
|
||||
' "PWD=`pwd`" "FILE=$FILENAME" $ERROUTPUT >&2
|
||||
|
||||
if [ "$RESULT" -ne 0 ]
|
||||
then
|
||||
rm -f $TMPFILE
|
||||
rm -f $ERROUTPUT
|
||||
rm -f $OBJSNAME
|
||||
exit $RESULT
|
||||
fi
|
||||
@ -31,7 +46,7 @@ DEPS=`awk '
|
||||
/^FastFileLoad/ {
|
||||
sub(/^FastFileLoad\(/, "");
|
||||
sub(/\)$/, "");
|
||||
print}' $TMPFILE | sort -u | while read FILE
|
||||
print}' $ERROUTPUT | sort -u | while read FILE
|
||||
do
|
||||
if [ -f "$FILE" ]
|
||||
then
|
||||
@ -40,6 +55,6 @@ DEPS=`awk '
|
||||
done`
|
||||
|
||||
echo $OBJSNAME: $DEPS > $DEPSNAME
|
||||
rm -f $TMPFILE
|
||||
rm -f $ERROUTPUT
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user