mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
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>
This commit is contained in:
@@ -9,7 +9,11 @@ from fbt.util import (
|
||||
|
||||
# Building initial C environment for libs
|
||||
env = ENV.Clone(
|
||||
tools=["compilation_db", "fwbin", "fbt_apps"],
|
||||
tools=[
|
||||
("compilation_db", {"COMPILATIONDB_COMSTR": "\tCDB\t${TARGET}"}),
|
||||
"fwbin",
|
||||
"fbt_apps",
|
||||
],
|
||||
COMPILATIONDB_USE_ABSPATH=False,
|
||||
BUILD_DIR=fw_build_meta["build_dir"],
|
||||
IS_BASE_FIRMWARE=fw_build_meta["type"] == "firmware",
|
||||
@@ -76,7 +80,6 @@ if not env["VERBOSE"]:
|
||||
HEXCOMSTR="\tHEX\t${TARGET}",
|
||||
BINCOMSTR="\tBIN\t${TARGET}",
|
||||
DFUCOMSTR="\tDFU\t${TARGET}",
|
||||
OPENOCDCOMSTR="\tFLASH\t${SOURCE}",
|
||||
)
|
||||
|
||||
|
||||
@@ -139,7 +142,7 @@ apps_c = fwenv.ApplicationsC(
|
||||
Value(fwenv["APPS"]),
|
||||
)
|
||||
# Adding dependency on manifest files so apps.c is rebuilt when any manifest is changed
|
||||
fwenv.Depends(apps_c, fwenv.GlobRecursive("*.fam", "applications"))
|
||||
fwenv.Depends(apps_c, fwenv.GlobRecursive("*.fam", "#/applications"))
|
||||
|
||||
sources = [apps_c]
|
||||
# Gather sources only from app folders in current configuration
|
||||
@@ -164,6 +167,8 @@ fwenv.AppendUnique(
|
||||
"-u",
|
||||
"_printf_float",
|
||||
"-n",
|
||||
"-Xlinker",
|
||||
"-Map=${TARGET}.map",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -202,7 +207,6 @@ fwelf = fwenv["FW_ELF"] = fwenv.Program(
|
||||
],
|
||||
)
|
||||
|
||||
# Make it depend on everything child builders returned
|
||||
# Firmware depends on everything child builders returned
|
||||
Depends(fwelf, lib_targets)
|
||||
# Output extra details after building firmware
|
||||
@@ -232,7 +236,8 @@ if should_gen_cdb_and_link_dir(fwenv, BUILD_TARGETS):
|
||||
fwcdb = fwenv.CompilationDatabase()
|
||||
# without filtering, both updater & firmware commands would be generated
|
||||
fwenv.Replace(COMPILATIONDB_PATH_FILTER=fwenv.subst("*${FW_FLAVOR}*"))
|
||||
Depends(fwcdb, fwelf)
|
||||
AlwaysBuild(fwcdb)
|
||||
Alias(fwenv["FIRMWARE_BUILD_CFG"] + "_cdb", fwcdb)
|
||||
fw_artifacts.append(fwcdb)
|
||||
|
||||
# Adding as a phony target, so folder link is updated even if elf didn't change
|
||||
|
||||
Reference in New Issue
Block a user