2022-11-28 06:52:08 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
|
|
|
|
project(rv32fw C)
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} src/main.c)
|
|
|
|
|
2022-12-04 08:55:47 +00:00
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE -Os)
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE -nostdlib)
|
|
|
|
|
2022-11-28 06:52:08 +00:00
|
|
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
2022-11-28 07:54:18 +00:00
|
|
|
COMMAND ${CMAKE_OBJCOPY} -j .text -O verilog --verilog-data-width=4 "$<TARGET_FILE:${PROJECT_NAME}>" rv32fw.hex
|
|
|
|
COMMENT "Invoking: Verilog Hexdump"
|
|
|
|
VERBATIM)
|