48 lines
1017 B
Python
48 lines
1017 B
Python
"""
|
|
Vhex kernel build script
|
|
"""
|
|
import os
|
|
import sys
|
|
|
|
from scripts.core.cmake import cmake_build
|
|
|
|
__all__ = [
|
|
'build_entry'
|
|
]
|
|
|
|
__HELP__ = """ usage: vxdev build [OPTIONS] ...
|
|
|
|
Build script for the Vhex kernel
|
|
|
|
Options:
|
|
-h, --help display this message
|
|
-v, --verbose display more information during the building process
|
|
"""
|
|
|
|
#---
|
|
# Public
|
|
#---
|
|
|
|
def build_entry(argv):
|
|
""" Build entry """
|
|
if '-h' in argv or '--help' in argv:
|
|
print(__HELP__)
|
|
sys.exit(0)
|
|
|
|
enable_verbose = False
|
|
for arg in argv:
|
|
if arg in ['-v', '--verbose']:
|
|
enable_verbose = True
|
|
continue
|
|
print(f"unrecognized argument '{arg}'", file=sys.stderr)
|
|
sys.exit(84)
|
|
|
|
if 'VXSDK_PREFIX_BUILD' not in os.environ:
|
|
print(
|
|
"unable to generate the configuration file, you should use the "
|
|
"vxSDK",
|
|
file=sys.stderr
|
|
)
|
|
sys.exit(84)
|
|
return cmake_build(os.environ['VXSDK_PREFIX_BUILD'], enable_verbose)
|