diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-05-12 11:43:32 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-05-12 11:43:32 +0200 |
commit | 49b39288133272578b8be86e3ced4468927fce5b (patch) | |
tree | 8d6e45289d6fd4de480c252255c4f93c211c6731 /build.bat | |
parent | 40b4d52e905227849785f6520d0381f19657820a (diff) |
Cleanup build
Diffstat (limited to 'build.bat')
-rw-r--r-- | build.bat | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -1,5 +1,18 @@ -clang emulator/main.c -o emulator.exe -std=c11 -D_CRT_SECURE_NO_WARNINGS -I.
-clang emulator/hart_test.c -o hart_test.exe -std=c11 -D_CRT_SECURE_NO_WARNINGS -I.
+@echo off
-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
|