Use single build script

This commit is contained in:
Kak 2024-06-27 18:01:29 +02:00
parent 173f70a535
commit 4d760abc10
8 changed files with 57 additions and 93 deletions

3
.gitignore vendored
View File

@ -20,4 +20,5 @@ tempconv.bin
tempconv.asm
shell.cmd
temp.asm
wl*.asm
wl*.asm
shell.lnk

52
_build.cmd Normal file
View File

@ -0,0 +1,52 @@
@echo off
setlocal enableextensions enabledelayedexpansion
set source=%~1
set filename=%~2
set comparison=%~3
if "%filename%" == "" (
echo Don't execute this file directly.
goto end
)
set searchStr=-nofix
call:inStr %*
set nofix=%ERRORLEVEL%
echo Assembling...
rgbds\rgbasm -h -L -vo -v -o %filename%.o %source%.asm
if %ERRORLEVEL% neq 0 goto assemble_fail
echo Linking...
rgbds\rgblink -m %filename%.map -n %filename%.sym -d -o %filename%.gb %filename%.o
if %ERRORLEVEL% neq 0 goto link_fail
echo ==========================
echo Build Success.
echo ==========================
if %nofix% equ 0 (
echo Fixing header checksum...
rgbds\rgbfix -v %filename%.gb
)
if NOT "%comparison%" == "" if EXIST %comparison% ( fc /B %filename%.gb %comparison% | more )
goto end
:assemble_fail
echo Error while assembling.
goto fail
:link_fail
echo Error while linking.
:fail
echo ==========================
echo Build failure.
echo ==========================
:end
pause
exit /b
:inStr
set args=%*
if not "x!args:%searchStr%=!"=="x%args%" ( exit /b 1 )
exit /b 0

View File

@ -1,31 +1 @@
@echo off
echo Assembling...
rgbds\rgbasm -h -L -vo -v -o wl.o config_nojunk.asm
if %ERRORLEVEL% neq 0 goto assemble_fail
echo Linking...
rgbds\rgblink -m wl.map -n wl.sym -d -o wl.gb wl.o
if %ERRORLEVEL% neq 0 goto link_fail
echo ==========================
echo Build Success.
echo ==========================
echo Fixing header checksum...
rgbds\rgbfix -v wl.gb
if EXIST original.gb ( fc /B wl.gb original.gb )
goto end
:assemble_fail
echo Error while assembling.
goto fail
:link_fail
echo Error while linking.
:fail
echo ==========================
echo Build failure.
echo ==========================
:end
pause
@_build config-nojunk wl

View File

@ -1,30 +1 @@
@echo off
echo Assembling...
rgbds\rgbasm -v -o wl.o config_test.asm
if %ERRORLEVEL% neq 0 goto assemble_fail
echo Linking...
rgbds\rgblink -m wl.map -n wl.sym -d -o wl.gb wl.o
if %ERRORLEVEL% neq 0 goto link_fail
echo ==========================
echo Build Success.
echo ==========================
echo Fixing header checksum...
rgbds\rgbfix -v wl.gb
goto end
:assemble_fail
echo Error while assembling.
goto fail
:link_fail
echo Error while linking.
:fail
echo ==========================
echo Build failure.
echo ==========================
:end
pause
@_build config-test wl

View File

@ -1,31 +1 @@
@echo off
echo Assembling...
rgbds\rgbasm -h -L -vo -v -o wl.o config_original.asm
if %ERRORLEVEL% neq 0 goto assemble_fail
echo Linking...
rgbds\rgblink -m wl.map -n wl.sym -d -o wl.gb wl.o
if %ERRORLEVEL% neq 0 goto link_fail
echo ==========================
echo Build Success.
echo ==========================
echo Fixing header checksum...
rgbds\rgbfix -v wl.gb
if EXIST original.gb ( fc /B wl.gb original.gb )
goto end
:assemble_fail
echo Error while assembling.
goto fail
:link_fail
echo Error while linking.
:fail
echo ==========================
echo Build failure.
echo ==========================
:end
pause
@_build config-original wl original.gb