refactor: use cmake macros to do objcopy, install and tests
All checks were successful
All checks were successful
This commit is contained in:
parent
f6c3a13e7f
commit
8630fe7667
12 changed files with 64 additions and 54 deletions
|
@ -12,9 +12,5 @@ add_executable(demo
|
|||
target_include_directories(demo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
target_link_libraries(demo PRIVATE am-${ARCH} klib)
|
||||
|
||||
# -- Extract binary file from ELF
|
||||
add_custom_command(TARGET demo
|
||||
COMMAND ${CMAKE_OBJCOPY} ARGS -S --set-section-flags .bss=alloc,contents -O binary demo demo.bin)
|
||||
|
||||
install(TARGETS demo RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/am-kernels)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/demo.bin DESTINATION ${CMAKE_INSTALL_DATADIR}/am-kernels)
|
||||
create_binary(demo)
|
||||
install_target_and_binary(demo)
|
||||
|
|
|
@ -36,9 +36,9 @@ int main(const char *args) {
|
|||
}
|
||||
|
||||
printf("Press Q to Exit\n");
|
||||
while (1) {
|
||||
AM_INPUT_KEYBRD_T ev = io_read(AM_INPUT_KEYBRD);
|
||||
if (ev.keydown && ev.keycode == AM_KEY_Q) break;
|
||||
}
|
||||
// while (1) {
|
||||
// AM_INPUT_KEYBRD_T ev = io_read(AM_INPUT_KEYBRD);
|
||||
// if (ev.keydown && ev.keycode == AM_KEY_Q) break;
|
||||
// }
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue