2020-04-22 21:25:57 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-12-31 00:05:02 +01:00
|
|
|
set -e
|
|
|
|
|
2020-04-22 21:25:57 +02:00
|
|
|
FILTER="grep -v warning"
|
|
|
|
|
|
|
|
sub()
|
|
|
|
{
|
|
|
|
|
2022-12-31 00:05:02 +01:00
|
|
|
CFLAGS="-Wall -I../ $OPT2"
|
|
|
|
CXX=${CXX:=g++}
|
|
|
|
|
2020-04-22 21:25:57 +02:00
|
|
|
echo "compile address.cpp"
|
2022-12-31 00:05:02 +01:00
|
|
|
$CXX $CFLAGS address.cpp -o address
|
2020-04-22 21:25:57 +02:00
|
|
|
|
|
|
|
./address $1 > a.asm
|
|
|
|
echo "asm"
|
|
|
|
$EXE -f$OPT3 a.asm -l a.lst
|
2021-03-27 22:08:22 +01:00
|
|
|
awk '{printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst
|
2020-04-22 21:25:57 +02:00
|
|
|
|
|
|
|
echo "xbyak"
|
|
|
|
./address $1 jit > nm.cpp
|
|
|
|
echo "compile nm_frame.cpp"
|
2022-12-31 00:05:02 +01:00
|
|
|
$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame
|
2020-04-22 21:25:57 +02:00
|
|
|
./nm_frame > x.lst
|
|
|
|
diff ok.lst x.lst && echo "ok"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" = "64" ]; then
|
|
|
|
echo "nasm(64bit)"
|
|
|
|
EXE=nasm
|
|
|
|
OPT2=-DXBYAK64
|
|
|
|
OPT3=win64
|
|
|
|
|
|
|
|
sub 1
|
|
|
|
sub 2
|
|
|
|
else
|
|
|
|
echo "nasm(32bit)"
|
|
|
|
EXE=nasm
|
|
|
|
OPT2=-DXBYAK32
|
|
|
|
OPT3=win32
|
|
|
|
sub 1
|
|
|
|
fi
|
|
|
|
|