Cleanup build

This commit is contained in:
2024-05-12 11:43:32 +02:00
parent 40b4d52e90
commit 49b3928813
5 changed files with 20 additions and 11 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
*.exe build
*.bin

View File

@ -1,5 +1,18 @@
clang emulator/main.c -o emulator.exe -std=c11 -D_CRT_SECURE_NO_WARNINGS -I. @echo off
clang emulator/hart_test.c -o hart_test.exe -std=c11 -D_CRT_SECURE_NO_WARNINGS -I.
clang --target=riscv32 -march=rv32i -e _main -nostdlib main.asm -o main.bin SET BUILD_OPTS= -std=c11 -D_CRT_SECURE_NO_WARNINGS -I.
IF NOT EXIST build mkdir build
echo emulator.lib
clang emulator/lib.c -o build/emulator.lib %BUILD_OPTS% -fuse-ld=llvm-lib
echo emulator.exe
clang emulator/main.c build/emulator.lib -o build/emulator.exe %BUILD_OPTS%
echo hart_test.exe
clang emulator/hart_test.c build/emulator.lib -o build/hart_test.exe %BUILD_OPTS%
echo main.bin
clang --target=riscv32 -march=rv32i -e _main -nostdlib main.asm -o build/main.bin

View File

@ -247,5 +247,3 @@ int main(int argc, char* argv[])
test(); test();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#include "emulator/hart.c"

3
emulator/lib.c Normal file
View File

@ -0,0 +1,3 @@
#include "hart.c"
#include "elf.c"

View File

@ -31,7 +31,3 @@ int main(int argc, char* argv[])
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#include "emulator/hart.c"
#include "emulator/elf.c"