|
@@ -62,13 +62,18 @@ add_custom_command(OUTPUT extracted_kernel_main
|
|
|
COMMAND ar xf ${PROJECT_BINARY_DIR}/libkernel_main.a --output=${EXTRACT_DIR}
|
|
|
)
|
|
|
|
|
|
-add_custom_target(boot.img
|
|
|
+add_custom_target(kernel.out
|
|
|
DEPENDS extracted_bootloader
|
|
|
DEPENDS extracted_kernel_main
|
|
|
COMMAND ld -T ${CMAKE_SOURCE_DIR}/ldscript.ld ${EXTRACT_DIR}/*.o
|
|
|
- -melf_i386 --oformat=binary -o ${CMAKE_BINARY_DIR}/boot.img
|
|
|
+ -melf_i386 -o ${CMAKE_BINARY_DIR}/kernel.out
|
|
|
)
|
|
|
|
|
|
+add_custom_target(boot.img
|
|
|
+ DEPENDS kernel.out
|
|
|
+ COMMAND objcopy --strip-debug -O binary
|
|
|
+ ${CMAKE_BINARY_DIR}/kernel.out boot.img)
|
|
|
+
|
|
|
add_custom_command(OUTPUT run
|
|
|
POST_BUILD
|
|
|
DEPENDS boot.img
|