Mercurial > hg > Members > anatofuz > CbC_xv6
diff src/CMakeLists.txt @ 66:101b229f182d cmake
build initcode
author | anatofuz |
---|---|
date | Fri, 26 Jul 2019 19:24:31 +0900 |
parents | 58c79e0c5101 |
children | f236eba62a76 |
line wrap: on
line diff
--- a/src/CMakeLists.txt Fri Jul 26 18:46:36 2019 +0900 +++ b/src/CMakeLists.txt Fri Jul 26 19:24:31 2019 +0900 @@ -3,6 +3,7 @@ set(BUILD_DIR ${PROJECT_BINARY_DIR}) add_subdirectory(tools) add_subdirectory(usr) +enable_language(C ASM) set(USE_CUDA,0) @@ -35,6 +36,7 @@ configure_file("${CMAKE_SOURCE_DIR}/kernel-cmake.ld" "${CMAKE_CURRENT_BINARY_DIR}/kernel-cmake.ld" COPYONLY) macro( GearsCommand ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXV6KERNEL") set(CMAKE_C_COMPILER "${CBC_COM}") set(CMAKE_LINKER "${X_CMAKE_LINKER}") set(CMAKE_C_LINK_EXECUTABLE "${X_CMAKE_C_LINK_EXECUTABLE}") @@ -71,14 +73,22 @@ #target_link_libraries(syslib) add_custom_command ( OUTPUT c/${_Gears_TARGET}-context.c - DEPENDS ${_Gears_CBC_SOURCES} fs.img + DEPENDS ${_Gears_CBC_SOURCES} fs.img initcode COMMAND "perl" "gearsTools/generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CBC_SOURCES} ) add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c ) # target_link_libraries(${_Gears_TARGET} m pthread) endmacro() -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXV6KERNEL") + +set(CMAKE_C_FLAGS "${INITOCDE_CFLAGS}") +set(CMAKE_ASM_LINK_EXECUTABLE "${INITOCDE_LINK_EXECUTABLE}") +add_executable(initcode.o initcode.S) +add_custom_command( + OUTPUT initcode + DEPENDS initcode.o + COMMAND "arm-none-eabi-objcopy" "-S" "-O" "binary" "--prefix-symbols=\"_binary_build/initcode\"" "initcode.o" "initcode" +) GearsCommand ( TARGET