unleashed-firmware/applications/extapps.scons
hedger a1637e9216
fbt fixes & improvements (#1490)
* fbt: minimal USB flash mode; scripts: faster storage.py with larger chunks
* fbt: fixed creation of temporary file nodes confusing scons
* docs: removed refs to --with-updater
* fbt: removed splashscreen from minimal update package
* fbt: renamed dist arguments for consistency
* docs: fixed updater_debug target
* fbt: separate target for generating compilation_database.json without building the code.
* fbt: added `jflash` target for programming over JLink probe; refactored usb flashing targets
* fbt: building updater_app in unit_tests configuration
* fbt: fixed reset behavior after flashing with J-Link
* fbt: generating .map file for firmware binary & external apps
* fbt/core: moved library contents before apps code

Co-authored-by: あく <alleteam@gmail.com>
2022-08-02 22:46:43 +09:00

58 lines
1.3 KiB
Text

Import("ENV")
from fbt.appmanifest import FlipperAppType
appenv = ENV.Clone(tools=["fbt_extapps"])
appenv.Replace(
LINKER_SCRIPT="application-ext",
STRIPFLAGS=[
"--strip-debug",
"--strip-unneeded",
"-d",
"-g",
"-S",
],
)
appenv.AppendUnique(
CCFLAGS=[
"-Os",
"-ggdb3",
"-mword-relocations",
"-mlong-calls",
"-fno-common",
"-nostdlib",
"-fvisibility=hidden",
],
LINKFLAGS=[
"-r",
"-s",
# "-Bsymbolic",
"-nostartfiles",
"-mlong-calls",
"-fno-common",
"-nostdlib",
"-Wl,--gc-sections",
"-Wl,--no-export-dynamic",
"-fvisibility=hidden",
"-Wl,-e${APP_ENTRY}",
"-Xlinker",
"-Map=${TARGET}.map",
],
)
extapps = []
for apptype in (FlipperAppType.PLUGIN, FlipperAppType.EXTERNAL):
for app in appenv["APPBUILD"].get_apps_of_type(apptype):
extapps.append(appenv.BuildAppElf(app))
# Ugly access to global option
if extra_app_list := GetOption("extra_ext_apps"):
for extra_app in extra_app_list.split(","):
extapps.append(appenv.BuildAppElf(appenv["APPMGR"].get(extra_app)))
Alias(appenv["FIRMWARE_BUILD_CFG"] + "_extapps", extapps)
Return("extapps")