native: build zephyr.exe for posix arch
To indicate the generated binary is executable on the host, add .exe extension to the generated ELF file. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
fd276aeb42
commit
4592ff2d5a
4 changed files with 16 additions and 1 deletions
|
@ -760,6 +760,7 @@ list_append_ifdef(
|
||||||
post_build_commands
|
post_build_commands
|
||||||
COMMAND ${CMAKE_OBJCOPY} -S -Obinary -R .comment -R COMMON -R .eh_frame ${KERNEL_ELF_NAME} ${KERNEL_BIN_NAME}
|
COMMAND ${CMAKE_OBJCOPY} -S -Obinary -R .comment -R COMMON -R .eh_frame ${KERNEL_ELF_NAME} ${KERNEL_BIN_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
list_append_ifdef(
|
list_append_ifdef(
|
||||||
CONFIG_BUILD_OUTPUT_S19
|
CONFIG_BUILD_OUTPUT_S19
|
||||||
post_build_commands
|
post_build_commands
|
||||||
|
@ -784,6 +785,12 @@ list_append_ifdef(
|
||||||
COMMAND ${CMAKE_STRIP} --strip-all ${KERNEL_ELF_NAME} -o ${KERNEL_STRIP_NAME}
|
COMMAND ${CMAKE_STRIP} --strip-all ${KERNEL_ELF_NAME} -o ${KERNEL_STRIP_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
list_append_ifdef(
|
||||||
|
CONFIG_BUILD_OUTPUT_EXE
|
||||||
|
post_build_commands
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E rename ${KERNEL_ELF_NAME} ${KERNEL_EXE_NAME}
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${logical_target_for_zephyr_elf}
|
TARGET ${logical_target_for_zephyr_elf}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
|
|
|
@ -237,6 +237,7 @@ set(KERNEL_HEX_NAME ${KERNEL_NAME}.hex)
|
||||||
set(KERNEL_MAP_NAME ${KERNEL_NAME}.map)
|
set(KERNEL_MAP_NAME ${KERNEL_NAME}.map)
|
||||||
set(KERNEL_LST_NAME ${KERNEL_NAME}.lst)
|
set(KERNEL_LST_NAME ${KERNEL_NAME}.lst)
|
||||||
set(KERNEL_S19_NAME ${KERNEL_NAME}.s19)
|
set(KERNEL_S19_NAME ${KERNEL_NAME}.s19)
|
||||||
|
set(KERNEL_EXE_NAME ${KERNEL_NAME}.exe)
|
||||||
set(KERNEL_STAT_NAME ${KERNEL_NAME}.stat)
|
set(KERNEL_STAT_NAME ${KERNEL_NAME}.stat)
|
||||||
set(KERNEL_STRIP_NAME ${KERNEL_NAME}.strip)
|
set(KERNEL_STRIP_NAME ${KERNEL_NAME}.strip)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
add_custom_target(run
|
add_custom_target(run
|
||||||
COMMAND
|
COMMAND
|
||||||
${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME}
|
${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_EXE_NAME}
|
||||||
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
|
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
)
|
)
|
||||||
|
|
|
@ -197,6 +197,13 @@ config BUILD_OUTPUT_BIN
|
||||||
Build a binary in BIN format. This will build a zephyr.bin file need
|
Build a binary in BIN format. This will build a zephyr.bin file need
|
||||||
by some platforms.
|
by some platforms.
|
||||||
|
|
||||||
|
config BUILD_OUTPUT_EXE
|
||||||
|
bool "Build a binary in ELF format with .exe extension"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Build a binary in ELF format that can run in the host system. This
|
||||||
|
will build a zephyr.exe file.
|
||||||
|
|
||||||
config BUILD_OUTPUT_S19
|
config BUILD_OUTPUT_S19
|
||||||
bool "Build a binary in S19 format"
|
bool "Build a binary in S19 format"
|
||||||
default n
|
default n
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue