Capture build errors in xcode
This commit is contained in:
parent
e4e28bedb6
commit
192a615aa9
|
@ -0,0 +1,59 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
PWD=`pwd`
|
||||||
|
|
||||||
|
$* 2> /tmp/errors.$$
|
||||||
|
RESULT=$?
|
||||||
|
|
||||||
|
if [ $RESULT -ne 0 ]
|
||||||
|
then
|
||||||
|
exec /usr/bin/perl -x $0 $RESULT /tmp/errors.$$ "$PWD"
|
||||||
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my $result = $ARGV[0];
|
||||||
|
my $filename = $ARGV[1];
|
||||||
|
my $pwd = $ARGV[2];
|
||||||
|
|
||||||
|
open(FILE, "<$filename") || die "$0: Unable to open file, $!";
|
||||||
|
|
||||||
|
my $unresolvedRefError = undef;
|
||||||
|
|
||||||
|
while (<FILE>) {
|
||||||
|
chomp;
|
||||||
|
|
||||||
|
if (defined $unresolvedRefError) {
|
||||||
|
if (m/^ ([^(]+)\(([0-9]+)\)/) {
|
||||||
|
my $file = $1;
|
||||||
|
my $lineno = $2;
|
||||||
|
|
||||||
|
if (! -f "$pwd/$file") {
|
||||||
|
$file =~ s/\.s$/.c/;
|
||||||
|
}
|
||||||
|
|
||||||
|
$_ = "$pwd/$file:$lineno:0: Error: $unresolvedRefError";
|
||||||
|
} else {
|
||||||
|
$unresolvedRefError = undef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m/^(Unresolved external .* referenced) in:/) {
|
||||||
|
$unresolvedRefError = $1;
|
||||||
|
$_ = "";
|
||||||
|
} elsif (m/^([^(]+)\(([0-9]+)\):(.*)$/) {
|
||||||
|
my $file = $1;
|
||||||
|
my $lineno = $2;
|
||||||
|
my $error = $3;
|
||||||
|
|
||||||
|
$_ = "$pwd/$file:$lineno:0:$error";
|
||||||
|
}
|
||||||
|
print STDERR "$_\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink($filename);
|
||||||
|
|
||||||
|
exit($result);
|
|
@ -95,7 +95,7 @@ cleanMacCruft:
|
||||||
rm -rf pkg
|
rm -rf pkg
|
||||||
|
|
||||||
$(PGM): $(OBJS)
|
$(PGM): $(OBJS)
|
||||||
$(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o "$(PGM)" $(OBJS)
|
make/errorFilter.sh $(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o "$(PGM)" $(OBJS)
|
||||||
|
|
||||||
$(DISKIMAGE): $(PGM)
|
$(DISKIMAGE): $(PGM)
|
||||||
make/createDiskImage $(AC) $(MACHINE) "$(DISKIMAGE)" "$(PGM)" "$(START_ADDR)" $(COPYDIRS)
|
make/createDiskImage $(AC) $(MACHINE) "$(DISKIMAGE)" "$(PGM)" "$(START_ADDR)" $(COPYDIRS)
|
||||||
|
@ -104,12 +104,12 @@ execute: $(DISKIMAGE)
|
||||||
osascript make/V2Make.scpt "$(CWD)" "$(PGM)" "$(CWD)/make/DevApple.vii" "$(EXECCMD)"
|
osascript make/V2Make.scpt "$(CWD)" "$(PGM)" "$(CWD)/make/DevApple.vii" "$(EXECCMD)"
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CL65) $(MACHCONFIG) $(CFLAGS) --create-dep -c -o $@ $<
|
make/errorFilter.sh $(CL65) $(MACHCONFIG) $(CFLAGS) --create-dep -c -o $@ $<
|
||||||
sed -i .bak 's/\.s:/.o:/' $(@:.o=.u)
|
sed -i .bak 's/\.s:/.o:/' $(@:.o=.u)
|
||||||
rm -f $(@:.o=.u).bak
|
rm -f $(@:.o=.u).bak
|
||||||
|
|
||||||
%.o: %.s
|
%.o: %.s
|
||||||
$(CL65) $(MACHCONFIG) --cpu $(CPU) $(ASMFLAGS) -l -c -o $@ $<
|
make/errorFilter.sh $(CL65) $(MACHCONFIG) --cpu $(CPU) $(ASMFLAGS) -l -c -o $@ $<
|
||||||
|
|
||||||
$(OBJS): Makefile
|
$(OBJS): Makefile
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<string>make/createDiskImage</string>
|
<string>make/createDiskImage</string>
|
||||||
<string>make/DevApple.vii</string>
|
<string>make/DevApple.vii</string>
|
||||||
<string>make/dos33_template.dsk</string>
|
<string>make/dos33_template.dsk</string>
|
||||||
|
<string>make/errorFilter.sh</string>
|
||||||
<string>make/head.mk</string>
|
<string>make/head.mk</string>
|
||||||
<string>make/prodos_template.dsk</string>
|
<string>make/prodos_template.dsk</string>
|
||||||
<string>make/tail.mk</string>
|
<string>make/tail.mk</string>
|
||||||
|
@ -30,6 +31,13 @@
|
||||||
<key>Path</key>
|
<key>Path</key>
|
||||||
<string>make/V2Make.scpt</string>
|
<string>make/V2Make.scpt</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>make/errorFilter.sh</key>
|
||||||
|
<dict>
|
||||||
|
<key>Group</key>
|
||||||
|
<string>make</string>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>make/errorFilter.sh</string>
|
||||||
|
</dict>
|
||||||
<key>make/tail.mk</key>
|
<key>make/tail.mk</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>Group</key>
|
<key>Group</key>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<string>make/createDiskImage</string>
|
<string>make/createDiskImage</string>
|
||||||
<string>make/DevApple.vii</string>
|
<string>make/DevApple.vii</string>
|
||||||
<string>make/dos33_template.dsk</string>
|
<string>make/dos33_template.dsk</string>
|
||||||
|
<string>make/errorFilter.sh</string>
|
||||||
<string>make/head.mk</string>
|
<string>make/head.mk</string>
|
||||||
<string>make/prodos_template.dsk</string>
|
<string>make/prodos_template.dsk</string>
|
||||||
<string>make/tail.mk</string>
|
<string>make/tail.mk</string>
|
||||||
|
@ -30,6 +31,13 @@
|
||||||
<key>Path</key>
|
<key>Path</key>
|
||||||
<string>make/V2Make.scpt</string>
|
<string>make/V2Make.scpt</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>make/errorFilter.sh</key>
|
||||||
|
<dict>
|
||||||
|
<key>Group</key>
|
||||||
|
<string>make</string>
|
||||||
|
<key>Path</key>
|
||||||
|
<string>make/errorFilter.sh</string>
|
||||||
|
</dict>
|
||||||
<key>make/tail.mk</key>
|
<key>make/tail.mk</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>Group</key>
|
<key>Group</key>
|
||||||
|
|
Loading…
Reference in New Issue