mirror of
https://github.com/jeremysrand/Apple2GSBuildPipeline.git
synced 2025-01-13 22:30:14 +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
|
#!/bin/bash
|
||||||
|
|
||||||
TMPFILE=/tmp/orca-cc.$$
|
STDOUTPUT=/tmp/orca-cc-std.$$
|
||||||
|
ERROUTPUT=/tmp/orca-cc-errs.$$
|
||||||
|
|
||||||
FILENAME="$1"
|
FILENAME="$1"
|
||||||
shift
|
shift
|
||||||
@ -28,14 +29,31 @@ DEPSNAME="${BASENAME}.d"
|
|||||||
OBJSNAME="${BASENAME}.a"
|
OBJSNAME="${BASENAME}.a"
|
||||||
ROOTNAME="${BASENAME}.root"
|
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=$?
|
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 ]
|
if [ "$RESULT" -ne 0 ]
|
||||||
then
|
then
|
||||||
rm -f $TMPFILE
|
rm -f $ERROUTPUT
|
||||||
|
rm -f $STDOUTPUT
|
||||||
rm -f $OBJSNAME
|
rm -f $OBJSNAME
|
||||||
rm -f $ROOTNAME
|
rm -f $ROOTNAME
|
||||||
exit $RESULT
|
exit $RESULT
|
||||||
@ -45,7 +63,7 @@ DEPS=`awk '
|
|||||||
/^FastFileLoad/ {
|
/^FastFileLoad/ {
|
||||||
sub(/^FastFileLoad\(/, "");
|
sub(/^FastFileLoad\(/, "");
|
||||||
sub(/\)$/, "");
|
sub(/\)$/, "");
|
||||||
print}' $TMPFILE | sort -u | while read FILE
|
print}' $ERROUTPUT | sort -u | while read FILE
|
||||||
do
|
do
|
||||||
if [ -f "$FILE" ]
|
if [ -f "$FILE" ]
|
||||||
then
|
then
|
||||||
@ -53,7 +71,8 @@ DEPS=`awk '
|
|||||||
fi
|
fi
|
||||||
done | tr '\012' ' '`
|
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
|
# 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.
|
# main.c file being compiled, we need the dependency on the .root file.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
TMPFILE=/tmp/orca-rez.$$
|
ERROUTPUT=/tmp/orca-rez-err.$$
|
||||||
|
|
||||||
FILENAME="$1"
|
FILENAME="$1"
|
||||||
shift
|
shift
|
||||||
@ -15,14 +15,29 @@ BASENAME=`echo $FILENAME | sed 's/\.rez$//'`
|
|||||||
DEPSNAME="${BASENAME}.rez.d"
|
DEPSNAME="${BASENAME}.rez.d"
|
||||||
OBJSNAME="${BASENAME}.r"
|
OBJSNAME="${BASENAME}.r"
|
||||||
|
|
||||||
$ORCA --trace-gsos compile $* keep="${OBJSNAME}" "$FILENAME" 2> $TMPFILE
|
$ORCA --trace-gsos compile $* keep="${OBJSNAME}" "$FILENAME" 2> $ERROUTPUT
|
||||||
RESULT=$?
|
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 ]
|
if [ "$RESULT" -ne 0 ]
|
||||||
then
|
then
|
||||||
rm -f $TMPFILE
|
rm -f $ERROUTPUT
|
||||||
rm -f $OBJSNAME
|
rm -f $OBJSNAME
|
||||||
exit $RESULT
|
exit $RESULT
|
||||||
fi
|
fi
|
||||||
@ -31,7 +46,7 @@ DEPS=`awk '
|
|||||||
/^FastFileLoad/ {
|
/^FastFileLoad/ {
|
||||||
sub(/^FastFileLoad\(/, "");
|
sub(/^FastFileLoad\(/, "");
|
||||||
sub(/\)$/, "");
|
sub(/\)$/, "");
|
||||||
print}' $TMPFILE | sort -u | while read FILE
|
print}' $ERROUTPUT | sort -u | while read FILE
|
||||||
do
|
do
|
||||||
if [ -f "$FILE" ]
|
if [ -f "$FILE" ]
|
||||||
then
|
then
|
||||||
@ -40,6 +55,6 @@ DEPS=`awk '
|
|||||||
done`
|
done`
|
||||||
|
|
||||||
echo $OBJSNAME: $DEPS > $DEPSNAME
|
echo $OBJSNAME: $DEPS > $DEPSNAME
|
||||||
rm -f $TMPFILE
|
rm -f $ERROUTPUT
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user