You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
382 B

#!/usr/bin/perl -w
my $obj=$ARGV[0];
$obj=~s/\.[c|S]$/.o/;
system(qq(rm -f $obj));
open F,qq(make $ARGV[0] CC='mips-elf-gcc -g3'|);
my $cmd;
while(<F>){$cmd=$_;last if/gcc/;};
close F;
shift @ARGV;
print STDERR "$cmd\n";
system qq($cmd);
system qq(cp $obj /tmp/tmp.o;mips-elf-objdump -Slz /tmp/tmp.o >/tmp/tmp.S);
$cmd=~s/\s-c\s/ @ARGV -E -C /;
print STDERR "$cmd\n";
system($cmd);