@echo on
COPY C:\Saturn~1\SET_ELF.BAT .\TMP.BAT
CALL TMP.BAT
DEL TMP.BAT


:start
echo --------------------------------------------
echo  Type `r' to rebuild program.
SET /P cm="Command: "

If "%cm%" == "r" goto rebuild
goto end


:rebuild
sh-elf-as -o anti_crt0.o anti_crt0.s
sh-elf-gcc -c -o copystub.o copystub.c
sh-elf-ld -T anti_lnkscript -e _start anti_crt0.o copystub.o
sh-elf-objcopy -O binary a.out copystub.bin
del a.out anti_crt0.o copystub.o
..\..\..\tools\bin2c copystub.bin copystub_inc.c
dir copystub.bin
echo OK!
goto start




:end

