Change scripts to powershell

This commit is contained in:
flysand7 2023-06-25 03:24:55 +11:00
parent 2a734fe46f
commit c1582bc4be
8 changed files with 33 additions and 18 deletions

1
.gitignore vendored
View File

@ -9,4 +9,5 @@ a.out
*.o
*.4coder
*.rdbg
test/
test_folder/

View File

@ -1,13 +0,0 @@
:: Compile UTF-8 resource into .obj file
:: this .obj file has to be linked to the executable using it, NOT archived
:: together with ciabatta.lib.
windres -o utf8.obj utf8.rc
:: Compile chkstk
nasm src\os_win\chkstk.asm -ochkstk.o -fwin64
:: Compile the rest of the party
clang -Wall src\ciabatta.c -o ciabatta.obj -c -DCIABATTA_WIN -I src -I include -nodefaultlibs -g -mfma
rem cuik src\ciabatta.c -o ciabatta.obj -c -DCIABATTA_WIN -I src -I inc -nostdlib
lib /nologo /out:ciabatta.lib chkstk.o utf8.obj ciabatta.obj

13
build.ps1 Normal file
View File

@ -0,0 +1,13 @@
# Generate the resources for UTF8
windres -o utf8.obj utf8.rc
# Compile chkstk
nasm src\os_win\chkstk.asm -o chkstk.o -fwin64
# Compile the rest of the party
clang -Wall src\ciabatta.c -o ciabatta.obj -c -DCIABATTA_WIN -I src -I include -nodefaultlibs -g -mfma
# rem cuik src\ciabatta.c -o ciabatta.obj -c -DCIABATTA_WIN -I src -I inc -nostdlib
# Package up the .lib file
lib /nologo /out:ciabatta.lib chkstk.o utf8.obj ciabatta.obj

View File

@ -1,5 +0,0 @@
clang -g test\%1.c -I include utf8.obj -nostdlib -mfma -lciabatta.lib
if %errorlevel%==0 (
"./a.exe"
)

19
test.ps1 Normal file
View File

@ -0,0 +1,19 @@
$FILENAME = $("tests/" + $args + ".c")
if(-not $(Test-Path -Path test_folder)) {
New-Item -ItemType Directory test_folder
}
if(-not $(Test-Path -Path test)) {
New-Item -ItemType Directory test
}
# Compile the test suite
clang -g $FILENAME -I include utf8.obj -nostdlib -mfma -l ciabatta.lib
# If succeeded run the test suite
if($?) {
./a.exe
}