This commit is contained in:
암냥 2026-06-23 09:56:21 +09:00
commit 5625d6bd14
11 changed files with 821 additions and 0 deletions

43
scripts/build.bat Normal file
View file

@ -0,0 +1,43 @@
@echo off
setlocal
if not exist build mkdir build
where cl >nul 2>nul
if %errorlevel% equ 0 goto build_msvc
where gcc >nul 2>nul
if %errorlevel% equ 0 goto build_gcc
where clang >nul 2>nul
if %errorlevel% equ 0 goto build_clang
echo C compiler not found. Install Visual Studio Build Tools, GCC, or Clang.
exit /b 1
:build_msvc
pushd build
cl /nologo /std:c11 /O2 /W4 /I..\include ^
..\src\main.c ..\src\encrypt.c ..\src\decrypt.c ..\src\cipher.c ^
/Fe:gerbera.exe bcrypt.lib
set "result=%errorlevel%"
popd
if not %result% equ 0 exit /b %result%
goto success
:build_gcc
gcc -Iinclude -std=c11 -O2 -Wall -Wextra -Wpedantic ^
src\main.c src\encrypt.c src\decrypt.c src\cipher.c ^
-o build\gerbera.exe -lbcrypt
if not %errorlevel% equ 0 exit /b %errorlevel%
goto success
:build_clang
clang -Iinclude -std=c11 -O2 -Wall -Wextra -Wpedantic ^
src\main.c src\encrypt.c src\decrypt.c src\cipher.c ^
-o build\gerbera.exe -lbcrypt
if not %errorlevel% equ 0 exit /b %errorlevel%
:success
echo Build complete: build\gerbera.exe
exit /b 0

20
scripts/build.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
set -eu
compiler="${CC:-cc}"
mkdir -p build
"$compiler" \
-Iinclude \
-std=c11 \
-O2 \
-Wall \
-Wextra \
-Wpedantic \
src/main.c \
src/encrypt.c \
src/decrypt.c \
src/cipher.c \
-o build/gerbera
echo "Build complete: build/gerbera"