From 4d59e081b312b7eec621f2f9cb634af7008fd4d2 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 9 Sep 2014 22:25:37 -0700 Subject: [PATCH] Switching from make to shell script for test building. --- .gitignore | 1 + src/alloy/frontend/ppc/test/Makefile | 45 ------------ .../frontend/ppc/test/{ => bin}/instr_add.bin | Bin .../frontend/ppc/test/{ => bin}/instr_add.dis | 2 +- .../frontend/ppc/test/{ => bin}/instr_add.map | 0 .../ppc/test/{ => bin}/instr_extrwi.bin | Bin .../ppc/test/{ => bin}/instr_extrwi.dis | 2 +- .../ppc/test/{ => bin}/instr_extrwi.map | 0 .../frontend/ppc/test/{ => bin}/instr_ori.bin | Bin .../frontend/ppc/test/{ => bin}/instr_ori.dis | 2 +- .../frontend/ppc/test/{ => bin}/instr_ori.map | 0 .../ppc/test/{ => bin}/instr_rlwimi.bin | Bin .../ppc/test/{ => bin}/instr_rlwimi.dis | 2 +- .../ppc/test/{ => bin}/instr_rlwimi.map | 0 .../ppc/test/{ => bin}/instr_subfe.bin | Bin .../ppc/test/{ => bin}/instr_subfe.dis | 2 +- .../ppc/test/{ => bin}/instr_subfe.map | 0 src/alloy/frontend/ppc/test/instr_add.o | Bin 741 -> 0 bytes src/alloy/frontend/ppc/test/update.sh | 66 ++++++++++++++++++ xenia-build.py | 2 +- 20 files changed, 73 insertions(+), 51 deletions(-) delete mode 100644 src/alloy/frontend/ppc/test/Makefile rename src/alloy/frontend/ppc/test/{ => bin}/instr_add.bin (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_add.dis (70%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_add.map (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_extrwi.bin (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_extrwi.dis (57%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_extrwi.map (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_ori.bin (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_ori.dis (57%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_ori.map (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_rlwimi.bin (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_rlwimi.dis (57%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_rlwimi.map (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_subfe.bin (100%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_subfe.dis (57%) rename src/alloy/frontend/ppc/test/{ => bin}/instr_subfe.map (100%) delete mode 100644 src/alloy/frontend/ppc/test/instr_add.o create mode 100755 src/alloy/frontend/ppc/test/update.sh diff --git a/.gitignore b/.gitignore index c976ca4a3..5f95bcf29 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ tmtags *.py[co] .coverage +*.o # ============================================================================== # Logs and dumps diff --git a/src/alloy/frontend/ppc/test/Makefile b/src/alloy/frontend/ppc/test/Makefile deleted file mode 100644 index 92d251725..000000000 --- a/src/alloy/frontend/ppc/test/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -BINUTILS=../../../../../third_party/binutils/bin/ -PPC_AS=$(BINUTILS)/powerpc-none-elf-as -PPC_LD=$(BINUTILS)/powerpc-none-elf-ld -PPC_OBJDUMP=$(BINUTILS)/powerpc-none-elf-objdump -PPC_NM=$(BINUTILS)/powerpc-none-elf-nm - -SRCS=$(wildcard *.s) -BINS=$(SRCS:.s=.bin) -DISASMS=$(SRCS:.s=.dis) -MAPS=$(SRCS:.s=.map) - -%.o: %.s - $(PPC_AS) \ - -a64 \ - -be \ - -mregnames \ - -mpower7 \ - -maltivec \ - -mvsx \ - -mvmx128 \ - -R \ - -o $@ \ - $< - -%.dis: %.o - $(PPC_OBJDUMP) --adjust-vma=0x100000 -Mpower7 -Mvmx128 -D -EB $< > $@ - -%.bin: %.o - $(PPC_LD) \ - -A powerpc:common64 \ - -melf64ppc \ - -EB \ - -nostdlib \ - --oformat binary \ - -Ttext 0x100000 \ - -e 0x100000 \ - -o $@ \ - $< -%.map: %.o - $(PPC_NM) \ - --numeric-sort \ - $< \ - > $@ - -all: $(BINS) $(DISASMS) $(MAPS) diff --git a/src/alloy/frontend/ppc/test/instr_add.bin b/src/alloy/frontend/ppc/test/bin/instr_add.bin similarity index 100% rename from src/alloy/frontend/ppc/test/instr_add.bin rename to src/alloy/frontend/ppc/test/bin/instr_add.bin diff --git a/src/alloy/frontend/ppc/test/instr_add.dis b/src/alloy/frontend/ppc/test/bin/instr_add.dis similarity index 70% rename from src/alloy/frontend/ppc/test/instr_add.dis rename to src/alloy/frontend/ppc/test/bin/instr_add.dis index ed98a5f7b..ccb1261ea 100644 --- a/src/alloy/frontend/ppc/test/instr_add.dis +++ b/src/alloy/frontend/ppc/test/bin/instr_add.dis @@ -1,5 +1,5 @@ -instr_add.o: file format elf64-powerpc +/cygdrive/d/dev/xenia/src/alloy/frontend/ppc/test/bin//instr_add.o: file format elf64-powerpc Disassembly of section .text: diff --git a/src/alloy/frontend/ppc/test/instr_add.map b/src/alloy/frontend/ppc/test/bin/instr_add.map similarity index 100% rename from src/alloy/frontend/ppc/test/instr_add.map rename to src/alloy/frontend/ppc/test/bin/instr_add.map diff --git a/src/alloy/frontend/ppc/test/instr_extrwi.bin b/src/alloy/frontend/ppc/test/bin/instr_extrwi.bin similarity index 100% rename from src/alloy/frontend/ppc/test/instr_extrwi.bin rename to src/alloy/frontend/ppc/test/bin/instr_extrwi.bin diff --git a/src/alloy/frontend/ppc/test/instr_extrwi.dis b/src/alloy/frontend/ppc/test/bin/instr_extrwi.dis similarity index 57% rename from src/alloy/frontend/ppc/test/instr_extrwi.dis rename to src/alloy/frontend/ppc/test/bin/instr_extrwi.dis index f5bb64aa8..d22c93faf 100644 --- a/src/alloy/frontend/ppc/test/instr_extrwi.dis +++ b/src/alloy/frontend/ppc/test/bin/instr_extrwi.dis @@ -1,5 +1,5 @@ -instr_extrwi.o: file format elf64-powerpc +/cygdrive/d/dev/xenia/src/alloy/frontend/ppc/test/bin//instr_extrwi.o: file format elf64-powerpc Disassembly of section .text: diff --git a/src/alloy/frontend/ppc/test/instr_extrwi.map b/src/alloy/frontend/ppc/test/bin/instr_extrwi.map similarity index 100% rename from src/alloy/frontend/ppc/test/instr_extrwi.map rename to src/alloy/frontend/ppc/test/bin/instr_extrwi.map diff --git a/src/alloy/frontend/ppc/test/instr_ori.bin b/src/alloy/frontend/ppc/test/bin/instr_ori.bin similarity index 100% rename from src/alloy/frontend/ppc/test/instr_ori.bin rename to src/alloy/frontend/ppc/test/bin/instr_ori.bin diff --git a/src/alloy/frontend/ppc/test/instr_ori.dis b/src/alloy/frontend/ppc/test/bin/instr_ori.dis similarity index 57% rename from src/alloy/frontend/ppc/test/instr_ori.dis rename to src/alloy/frontend/ppc/test/bin/instr_ori.dis index d7530581c..d2c2c2cd8 100644 --- a/src/alloy/frontend/ppc/test/instr_ori.dis +++ b/src/alloy/frontend/ppc/test/bin/instr_ori.dis @@ -1,5 +1,5 @@ -instr_ori.o: file format elf64-powerpc +/cygdrive/d/dev/xenia/src/alloy/frontend/ppc/test/bin//instr_ori.o: file format elf64-powerpc Disassembly of section .text: diff --git a/src/alloy/frontend/ppc/test/instr_ori.map b/src/alloy/frontend/ppc/test/bin/instr_ori.map similarity index 100% rename from src/alloy/frontend/ppc/test/instr_ori.map rename to src/alloy/frontend/ppc/test/bin/instr_ori.map diff --git a/src/alloy/frontend/ppc/test/instr_rlwimi.bin b/src/alloy/frontend/ppc/test/bin/instr_rlwimi.bin similarity index 100% rename from src/alloy/frontend/ppc/test/instr_rlwimi.bin rename to src/alloy/frontend/ppc/test/bin/instr_rlwimi.bin diff --git a/src/alloy/frontend/ppc/test/instr_rlwimi.dis b/src/alloy/frontend/ppc/test/bin/instr_rlwimi.dis similarity index 57% rename from src/alloy/frontend/ppc/test/instr_rlwimi.dis rename to src/alloy/frontend/ppc/test/bin/instr_rlwimi.dis index 254c85429..030025062 100644 --- a/src/alloy/frontend/ppc/test/instr_rlwimi.dis +++ b/src/alloy/frontend/ppc/test/bin/instr_rlwimi.dis @@ -1,5 +1,5 @@ -instr_rlwimi.o: file format elf64-powerpc +/cygdrive/d/dev/xenia/src/alloy/frontend/ppc/test/bin//instr_rlwimi.o: file format elf64-powerpc Disassembly of section .text: diff --git a/src/alloy/frontend/ppc/test/instr_rlwimi.map b/src/alloy/frontend/ppc/test/bin/instr_rlwimi.map similarity index 100% rename from src/alloy/frontend/ppc/test/instr_rlwimi.map rename to src/alloy/frontend/ppc/test/bin/instr_rlwimi.map diff --git a/src/alloy/frontend/ppc/test/instr_subfe.bin b/src/alloy/frontend/ppc/test/bin/instr_subfe.bin similarity index 100% rename from src/alloy/frontend/ppc/test/instr_subfe.bin rename to src/alloy/frontend/ppc/test/bin/instr_subfe.bin diff --git a/src/alloy/frontend/ppc/test/instr_subfe.dis b/src/alloy/frontend/ppc/test/bin/instr_subfe.dis similarity index 57% rename from src/alloy/frontend/ppc/test/instr_subfe.dis rename to src/alloy/frontend/ppc/test/bin/instr_subfe.dis index ae97535b8..c0ec805d3 100644 --- a/src/alloy/frontend/ppc/test/instr_subfe.dis +++ b/src/alloy/frontend/ppc/test/bin/instr_subfe.dis @@ -1,5 +1,5 @@ -instr_subfe.o: file format elf64-powerpc +/cygdrive/d/dev/xenia/src/alloy/frontend/ppc/test/bin//instr_subfe.o: file format elf64-powerpc Disassembly of section .text: diff --git a/src/alloy/frontend/ppc/test/instr_subfe.map b/src/alloy/frontend/ppc/test/bin/instr_subfe.map similarity index 100% rename from src/alloy/frontend/ppc/test/instr_subfe.map rename to src/alloy/frontend/ppc/test/bin/instr_subfe.map diff --git a/src/alloy/frontend/ppc/test/instr_add.o b/src/alloy/frontend/ppc/test/instr_add.o deleted file mode 100644 index 278d31452bb8ead454b9e2c8940183e35bf81111..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 741 zcmb<-^>JfjVq|~=Mg~zJ8%Y2z17b9Qc@9vLoq?q`^^}NT1A{_s0)%GJE3V8fNlXIL zB}EWA1I8*zttes8OGzwAWY9}0E(RMy1wtBV2F$%|Xy!RU`2uL-F!dl|MIeUpnbFh* zpz&c`n0gRj9f&!g66EL?1nNcC2Q`iXX1@+h07@g<4`MT+$wRqJ4p7DfAPou|Sopx) zD*+Va1Y#WaGhG16fdD8?AOmFkk;PHiKtr*r1BzpHFHjttJ3wY&Glv^V9OfSehLY6c OlK8}w6hk=6hyefw2O%W@ diff --git a/src/alloy/frontend/ppc/test/update.sh b/src/alloy/frontend/ppc/test/update.sh new file mode 100755 index 000000000..95d2ff9de --- /dev/null +++ b/src/alloy/frontend/ppc/test/update.sh @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +THIS_SCRIPT_DIR=$( cd "$( dirname "$0" )" && pwd ) + +BINUTILS=$THIS_SCRIPT_DIR/../../../../../third_party/binutils/bin/ +PPC_AS=$BINUTILS/powerpc-none-elf-as +PPC_LD=$BINUTILS/powerpc-none-elf-ld +PPC_OBJDUMP=$BINUTILS/powerpc-none-elf-objdump +PPC_NM=$BINUTILS/powerpc-none-elf-nm + +BIN=$THIS_SCRIPT_DIR/bin/ + +if [ -d "$BIN" ]; then + rm -f $BIN/*.o + rm -f $BIN/*.dis + rm -f $BIN/*.bin + rm -f $BIN/*.map +else + mkdir -p $BIN +fi + +SRCS=$THIS_SCRIPT_DIR/*.s +for SRC in $SRCS +do + SRC_NAME=$(basename $SRC) + OBJ_FILE=$BIN/${SRC_NAME%.*}.o + + $PPC_AS \ + -a64 \ + -be \ + -mregnames \ + -mpower7 \ + -maltivec \ + -mvsx \ + -mvmx128 \ + -R \ + -o $OBJ_FILE \ + $SRC + + $PPC_OBJDUMP \ + --adjust-vma=0x100000 \ + -Mpower7 \ + -Mvmx128 \ + -D \ + -EB \ + $OBJ_FILE \ + > $BIN/${SRC_NAME%.*}.dis + + $PPC_LD \ + -A powerpc:common64 \ + -melf64ppc \ + -EB \ + -nostdlib \ + --oformat binary \ + -Ttext 0x100000 \ + -e 0x100000 \ + -o $BIN/${SRC_NAME%.*}.bin \ + $OBJ_FILE + + $PPC_NM \ + --numeric-sort \ + $OBJ_FILE \ + > $BIN/${SRC_NAME%.*}.map + +done diff --git a/xenia-build.py b/xenia-build.py index b13f72c95..3d5a0ee8e 100755 --- a/xenia-build.py +++ b/xenia-build.py @@ -472,7 +472,7 @@ class TestCommand(Command): print('WARNING: test files not updated!'); else: print('Updating test files...') - result = shell_call('make -C src/alloy/frontend/ppc/') + result = shell_call('./src/alloy/frontend/ppc/test/update.sh') print('') if result != 0: return result