From 58a486334c3e5bbbd09da0e659ce3e4eec2c31d1 Mon Sep 17 00:00:00 2001 From: sfja Date: Thu, 5 Nov 2026 19:54:24 +0100 Subject: [PATCH] add boot.bin cmake target --- .gitignore | 2 +- CMakeLists.txt | 9 ++++++++- boot/CMakeLists.txt | 15 +++++++++++++++ program.vc6asm => boot/boot.vc6asm | 0 src/CMakeLists.txt | 5 +---- 5 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 boot/CMakeLists.txt rename program.vc6asm => boot/boot.vc6asm (100%) diff --git a/.gitignore b/.gitignore index 369d255..ffff840 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ build/ .vscode/ -program.bin + diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cbb489..9c148a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,13 @@ find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_subdirectory(src) +add_subdirectory(boot) - +add_custom_target( + run + DEPENDS emu boot/boot.bin + COMMAND emu boot/boot.bin + VERBATIM + USES_TERMINAL +) diff --git a/boot/CMakeLists.txt b/boot/CMakeLists.txt new file mode 100644 index 0000000..7790772 --- /dev/null +++ b/boot/CMakeLists.txt @@ -0,0 +1,15 @@ + + +add_custom_command( + OUTPUT boot.bin + DEPENDS asm ${PROJECT_SOURCE_DIR}/boot/boot.vc6asm + COMMAND asm ${PROJECT_SOURCE_DIR}/boot/boot.vc6asm -o boot.bin + VERBATIM +) + +add_custom_target( + boot.bin + ALL + DEPENDS boot.bin +) + diff --git a/program.vc6asm b/boot/boot.vc6asm similarity index 100% rename from program.vc6asm rename to boot/boot.vc6asm diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e13f9fa..ba095bd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,9 +15,6 @@ target_include_directories(isa PUBLIC .) add_executable(emu WIN32 emu.c) target_link_libraries(emu PRIVATE project_options isa SDL3::SDL3) -add_executable(asm WIN32 asm.c) +add_executable(asm asm.c) target_link_libraries(asm PRIVATE project_options isa) - - -