Skip to content

Commit

Permalink
ADD: add SPIFlash build routine
Browse files Browse the repository at this point in the history
  • Loading branch information
T-K-233 committed Sep 8, 2024
1 parent 6a1668b commit 00c914c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ set(CMAKE_SIZE "${TOOLCHAIN_PREFIX}size")


set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/..")
set(CMAKE_EXECUTABLE_SUFFIX ".riscv")
set(CMAKE_EXECUTABLE_SUFFIX ".riscv")


#################################
# Flags
#################################

# CPU architecture
set(ARCH "rv64imafdc")
set(ARCH "rv64imafd")
set(ABI "lp64d")
set(CMODEL "medany")
set(ARCH_FLAGS -march=${ARCH} -mabi=${ABI} -mcmodel=${CMODEL})
Expand Down Expand Up @@ -89,5 +89,15 @@ add_executable(mt-hello mt-hello.c)
add_executable(symmetric symmetric.c)


# spiflash.img: spiflash.py
# python3 $<
# Add custom command to generate spiflash.img from spiflash.py
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/spiflash.img
COMMAND python3 ${CMAKE_SOURCE_DIR}/spiflash.py
DEPENDS ${CMAKE_SOURCE_DIR}/spiflash.py
COMMENT "Generating spiflash.img"
)

# Add a target for spiflash.img
add_custom_target(spiflash_img ALL
DEPENDS ${CMAKE_BINARY_DIR}/spiflash.img
)

0 comments on commit 00c914c

Please sign in to comment.