mirror of
https://github.com/jeremysrand/CurtaSim.git
synced 2024-09-28 04:55:07 +00:00
Update the build engine to support capturing build errors in Xcode itself.
This commit is contained in:
parent
a1239d5666
commit
628963f505
@ -64,6 +64,7 @@
|
|||||||
9D24618F20D8B30C00227E1D /* curta.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = curta.c; sourceTree = "<group>"; };
|
9D24618F20D8B30C00227E1D /* curta.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = curta.c; sourceTree = "<group>"; };
|
||||||
9D24619020D8B30C00227E1D /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = "<group>"; };
|
9D24619020D8B30C00227E1D /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = "<group>"; };
|
||||||
9D24619120D8B30C00227E1D /* curtaUI.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = curtaUI.c; sourceTree = "<group>"; };
|
9D24619120D8B30C00227E1D /* curtaUI.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = curtaUI.c; sourceTree = "<group>"; };
|
||||||
|
9D45ABB620E1E564008C3F16 /* errorFilter.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = errorFilter.sh; path = make/errorFilter.sh; sourceTree = "<group>"; };
|
||||||
9D65A1BF20DCA472004268B7 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
9D65A1BF20DCA472004268B7 /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
@ -122,6 +123,7 @@
|
|||||||
9D24617020D8B2AE00227E1D /* createDiskImage */,
|
9D24617020D8B2AE00227E1D /* createDiskImage */,
|
||||||
9D24617220D8B2AE00227E1D /* DevApple.vii */,
|
9D24617220D8B2AE00227E1D /* DevApple.vii */,
|
||||||
9D24617420D8B2AE00227E1D /* dos33_template.dsk */,
|
9D24617420D8B2AE00227E1D /* dos33_template.dsk */,
|
||||||
|
9D45ABB620E1E564008C3F16 /* errorFilter.sh */,
|
||||||
9D24617620D8B2AE00227E1D /* head.mk */,
|
9D24617620D8B2AE00227E1D /* head.mk */,
|
||||||
9D24617820D8B2AE00227E1D /* prodos_template.dsk */,
|
9D24617820D8B2AE00227E1D /* prodos_template.dsk */,
|
||||||
9D24617A20D8B2AE00227E1D /* tail.mk */,
|
9D24617A20D8B2AE00227E1D /* tail.mk */,
|
||||||
|
Binary file not shown.
59
CurtaSim/make/errorFilter.sh
Executable file
59
CurtaSim/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
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user