vxkernel 0.6.0-27 : Fix assets generation

@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
This commit is contained in:
Yann MAGNIN 2022-12-10 13:30:44 +01:00
parent 20536b601b
commit 735c8b4103
4 changed files with 42 additions and 23 deletions

View File

@ -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")

View File

@ -14,3 +14,6 @@ modules = [
drivers = [
'mpu:common:sdl2'
]
install_files = [
'sdl2.ld'
]

View File

@ -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' : <list of driver pseudo-pathname>,
'modules' : <list of module pseudo-pathname>
},
'toolchain' : {
'file' : <toolchain file>,
'cflags' : <extra c flags>,
'libs' : <extra library needed>,
'ldflags' : <extra ld flags>
}
}
"""
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

View File

@ -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'
]