2022-06-11 04:49:07 +00:00
|
|
|
@echo off
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
|
|
|
|
:: Make sure that if I ctrl+c out of the script the dir is popped
|
|
|
|
:: If there's anything that requires user input, this script will break
|
|
|
|
:: in that case I recommend you removing the 'echo y' part.
|
|
|
|
:: although you will have to confirm termination of the script twice
|
|
|
|
if "%~1" neq "_start_" (
|
|
|
|
pushd %~pd0
|
|
|
|
echo y | cmd /c "%~f0" _start_ %*
|
|
|
|
popd
|
|
|
|
exit /b
|
|
|
|
)
|
|
|
|
shift /1
|
|
|
|
|
2022-07-06 02:31:15 +00:00
|
|
|
set CIABATTA_OPTIONS=-Iinc -I unicope\inc -Wall -g -gcodeview -nodefaultlibs -D_CRT_SECURE_NO_WARNINGS -mfma
|
2022-06-11 04:49:07 +00:00
|
|
|
set PLATFORM=win
|
|
|
|
|
|
|
|
if "%1"=="test" (
|
|
|
|
goto :skip_crt_compilation
|
|
|
|
)
|
2022-06-16 12:36:35 +00:00
|
|
|
|
|
|
|
if exist bin rd/s/q bin
|
|
|
|
mkdir bin
|
|
|
|
mkdir bin\%PLATFORM%
|
|
|
|
|
2022-06-11 04:49:07 +00:00
|
|
|
del ciabatta.lib 2> nul
|
2022-06-29 07:21:35 +00:00
|
|
|
call bake_cc.cmd
|
2022-06-22 12:36:26 +00:00
|
|
|
for /R src\%PLATFORM% %%F in (*.asm) do (
|
|
|
|
echo %%F
|
|
|
|
nasm %%F -f win64 -o bin\%PLATFORM%\%%~nF.obj
|
|
|
|
)
|
2022-06-16 12:36:35 +00:00
|
|
|
llvm-ar rc ciabatta.lib bin\*.obj bin\%PLATFORM%\*.obj
|
2022-06-11 04:49:07 +00:00
|
|
|
|
|
|
|
:skip_crt_compilation
|
2022-06-16 12:36:35 +00:00
|
|
|
|
2022-06-29 07:21:35 +00:00
|
|
|
if "%TEST%"=="" set TEST=threads
|
2022-06-16 12:36:35 +00:00
|
|
|
|
|
|
|
echo Compiling test_%TEST%.c
|
2022-06-22 12:36:26 +00:00
|
|
|
clang test\test_%TEST%.c ciabatta.lib -std=c11 -lDbghelp -lkernel32 -luser32 -lshell32 -nostdlib %CIABATTA_OPTIONS%
|
2022-06-11 04:49:07 +00:00
|
|
|
::cl test\test_math.c /Iinc -D_CRT_SECURE_NO_WARNINGS /Z7 /link ciabatta.lib kernel32.lib user32.lib shell32.lib -nostdlib -nodefaultlibs
|