mirror of
https://github.com/jeremysrand/colourgo.git
synced 2024-06-12 23:29:35 +00:00
Update the build engine to support capturing build errors in Xcode itself.
This commit is contained in:
parent
136314f3e1
commit
b656515517
|
@ -45,6 +45,7 @@
|
|||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
9D45ABB520E1E50D008C3F16 /* errorFilter.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = errorFilter.sh; path = make/errorFilter.sh; sourceTree = "<group>"; };
|
||||
9D55075F20DA0B6800B71EFD /* doNotBuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = doNotBuild; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
9D55076420DA0B6800B71EFD /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
|
||||
9D55076720DA0B6800B71EFD /* AppleCommander.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; name = AppleCommander.jar; path = make/AppleCommander.jar; sourceTree = "<group>"; };
|
||||
|
@ -123,6 +124,7 @@
|
|||
9D55076920DA0B6800B71EFD /* createDiskImage */,
|
||||
9D55076B20DA0B6900B71EFD /* DevApple.vii */,
|
||||
9D55076D20DA0B6900B71EFD /* dos33_template.dsk */,
|
||||
9D45ABB520E1E50D008C3F16 /* errorFilter.sh */,
|
||||
9D55076F20DA0B6900B71EFD /* head.mk */,
|
||||
9D55077120DA0B6900B71EFD /* prodos_template.dsk */,
|
||||
9D55077320DA0B6900B71EFD /* tail.mk */,
|
||||
|
|
Binary file not shown.
59
colourgo/make/errorFilter.sh
Executable file
59
colourgo/make/errorFilter.sh
Executable file
|
@ -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
|
||||
|
||||
$(PGM): $(OBJS)
|
||||
$(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o "$(PGM)" $(OBJS)
|
||||
make/errorFilter.sh $(CL65) $(MACHCONFIG) --mapfile $(MAPFILE) $(LDFLAGS) -o "$(PGM)" $(OBJS)
|
||||
|
||||
$(DISKIMAGE): $(PGM)
|
||||
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)"
|
||||
|
||||
%.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)
|
||||
rm -f $(@:.o=.u).bak
|
||||
|
||||
%.o: %.s
|
||||
$(CL65) $(MACHCONFIG) --cpu $(CPU) $(ASMFLAGS) -l -c -o $@ $<
|
||||
make/errorFilter.sh $(CL65) $(MACHCONFIG) --cpu $(CPU) $(ASMFLAGS) -l -c -o $@ $<
|
||||
|
||||
$(OBJS): Makefile
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user