1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

create windows build script

* Create build.bat

* Update build.bat

* added error handling

* changed error to match build.sh

* update readme to mention windows build script

---------

Co-authored-by: zyriu1 <Suvkq@hotmail.com>
Co-authored-by: p2r3 <41925384+p2r3@users.noreply.github.com>
This commit is contained in:
Anmol
2025-09-12 21:11:01 +05:30
committed by GitHub
parent 3d02dc02bf
commit 7206dd1b11
2 changed files with 29 additions and 1 deletions

28
build.bat Normal file
View File

@@ -0,0 +1,28 @@
@echo off
setlocal enabledelayedexpansion
if not exist "%~dp0src\registries.h" (
echo Error: 'include/registries.h' is missing.
echo Please follow the 'Compilation' section of the README to generate it.
pause
exit /b 1
)
set "files="
for /f "delims=" %%f in ('dir /b "%~dp0src\*.c" 2^>nul') do (
set "files=!files! "%~dp0src%%f""
)
if "%files%"=="" (
echo No C source files found in "%~dp0src".
echo Add .c files to the src folder and try again.
pause
exit /b 1
)
if exist "%~dp0bareiron.exe" del /q "%~dp0bareiron.exe"
gcc %files% -o "%~dp0bareiron.exe"
if errorlevel 1 (
echo Build failed.
pause
exit /b 1
) else (
echo Build succeeded: "%~dp0bareiron.exe"
pause
)