From 735c8b41030c3baee8d53528e3749c46b2cbd1d9 Mon Sep 17 00:00:00 2001 From: Yann MAGNIN Date: Sat, 10 Dec 2022 13:30:44 +0100 Subject: [PATCH] vxkernel 0.6.0-27 : Fix assets generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @update > [CMakeLists.txt] ¦ support extra file installation request (like linker script) > [boards] ¦ [sdl2] indicate that the sdl2.ld file (linker script) should be installed > [scripts/core/board] ¦ support extra file installation indication ¦ remove useless toolchain information (handled by the vxSDK) > [vxsdk.toml] ¦ indicate converter asset prefix ¦ use the new ENV handling ¦ indicate SDL2 linker script ¦ indicate SLD2 correct flags information --- CMakeLists.txt | 1 + boards/sdl2/board.toml | 3 +++ scripts/core/board.py | 39 +++++++++++++++++++-------------------- vxsdk.toml | 22 +++++++++++++++++++--- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b5504f..785f820 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,3 +106,4 @@ add_library(vxkernel ${VXKERNEL_SRC_TARGETS}) set(CMAKE_INSTALL_PREFIX ${VXSDK_PREFIX_INSTALL}) install(TARGETS vxkernel DESTINATION "lib") install(DIRECTORY kernel/include/ DESTINATION "include") +install(FILES ${VXKERNEL_INSTALL_EXTRA_FILES} DESTINATION "lib") diff --git a/boards/sdl2/board.toml b/boards/sdl2/board.toml index 5353bb6..51a58e0 100644 --- a/boards/sdl2/board.toml +++ b/boards/sdl2/board.toml @@ -14,3 +14,6 @@ modules = [ drivers = [ 'mpu:common:sdl2' ] +install_files = [ + 'sdl2.ld' +] diff --git a/scripts/core/board.py b/scripts/core/board.py index 0d7bc5f..c936fdc 100644 --- a/scripts/core/board.py +++ b/scripts/core/board.py @@ -57,25 +57,33 @@ def _board_fetch_info_config(board_info, board_desc, board): if 'config' not in board_desc: _warning(f"board '{board}' : missing config section") return -1 - if 'modules' not in board_desc['config']: + board_conf = board_desc['config'] + if 'modules' not in board_conf: _warning(f"board '{board}' : missing modules declaration") return -2 - if 'drivers' not in board_desc['config']: + if 'drivers' not in board_conf: _warning(f"board '{board}' : missing drivers declaration") return -3 mod_prefix = f"{__PROJ_PREFIX__}/kernel/src/modules" - for mod in board_desc['config']['modules']: + for mod in board_conf['modules']: if not os.path.exists(f"{mod_prefix}/{mod}"): _warning(f"{board} : module '{mod}' does not exists, skipped") continue board_info['config']['modules'].append(mod) drv_prefix = f"{__PROJ_PREFIX__}/kernel/src/drivers" - for drv in board_desc['config']['drivers']: + for drv in board_conf['drivers']: drv_path = drv.replace(':', '/') if not os.path.exists(f"{drv_prefix}/{drv_path}"): _warning(f"{board} : driver '{drv}' does not exists, skipped") continue board_info['config']['drivers'].append(drv_path) + if 'install_files' in board_conf: + for file in board_conf['install_files']: + file_pathname = f"{__PROJ_PREFIX__}/boards/{board}/{file}" + if not os.path.exists(file_pathname): + _warning("{board}: unable to find the file '{file}', skipped") + continue + board_info['config']['install_files'].append(file_pathname) return 0 def _board_fetch_info(board): @@ -89,12 +97,6 @@ def _board_fetch_info(board): 'drivers' : , 'modules' : }, - 'toolchain' : { - 'file' : , - 'cflags' : , - 'libs' : , - 'ldflags' : - } } """ board_info = { @@ -104,13 +106,8 @@ def _board_fetch_info(board): 'desc' : 'unknown', 'config' : { 'drivers' : [], - 'modules' : [] - }, - 'toolchain' : { - 'file' : None, - 'cflags' : [], - 'libs' : [], - 'ldflags' : [] + 'modules' : [], + 'install_files' : [] } } @@ -164,9 +161,11 @@ def _board_generate_conf(kernconf, board_info): @return > nothing """ - kernconf['VXKERNEL_ENABLE_BOARD'] = board_info['name'] - kernconf['VXKERNEL_ENABLE_MODULES'] = board_info['config']['modules'] - kernconf['VXKERNEL_ENABLE_DRIVERS'] = board_info['config']['drivers'] + bconf = board_info['config'] + kernconf['VXKERNEL_ENABLE_BOARD'] = board_info['name'] + kernconf['VXKERNEL_ENABLE_MODULES'] = bconf['modules'] + kernconf['VXKERNEL_ENABLE_DRIVERS'] = bconf['drivers'] + kernconf['VXKERNEL_INSTALL_EXTRA_FILES'] = bconf['install_files'] def _board_display_list(verbose, board_target): """ Display board information diff --git a/vxsdk.toml b/vxsdk.toml index 8104ea9..529e0b9 100644 --- a/vxsdk.toml +++ b/vxsdk.toml @@ -12,6 +12,10 @@ build = './vxdev build --verbose' install = './vxdev install' uninstall = './vxdev uninstall' +[converter] +assets_prefix = [ + 'kernel/assets' +] [fxcg50] [fxcg50.dependencies] @@ -27,13 +31,25 @@ uninstall = './vxdev uninstall' '-Wa,--dsp' ] VXSDK_PUBLIC_BUILD_LIBS = [ - '-lc', - '-lgcc' + '@COMMON@', + '-lvxkernel', + '@sh-elf-vhex@' ] [sdl2] [sdl2.env] VXSDK_COMMON_BUILD_CFLAGS = [ + '@COMMON@', '-D__VXKERNEL_SUPPORT_SDL2__', - '-g3' + '-g3', + ] + VXSDK_PUBLIC_BUILD_LIBS = [ + '@COMMON@', + '-Wl,--whole-archive', + '-lvxkernel', + '-Wl,--no-whole-archive', + '-lSDL2' + ] + VXSDK_LINKER_SCRIPT = [ + 'sdl2.ld' ]