2022-06-26 15:00:03 +03:00
|
|
|
Import("ENV")
|
|
|
|
|
|
|
|
|
|
|
|
if ENV["DEBUG"]:
|
|
|
|
ENV.Append(
|
|
|
|
CPPDEFINES=[
|
|
|
|
"FURI_DEBUG",
|
|
|
|
"NDEBUG",
|
|
|
|
],
|
|
|
|
CCFLAGS=[
|
|
|
|
"-Og",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
elif ENV["COMPACT"]:
|
|
|
|
ENV.Append(
|
|
|
|
CPPDEFINES=[
|
|
|
|
"FURI_NDEBUG",
|
|
|
|
"NDEBUG",
|
|
|
|
],
|
|
|
|
CCFLAGS=[
|
|
|
|
"-Os",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
ENV.Append(
|
|
|
|
CPPDEFINES=[
|
|
|
|
"FURI_NDEBUG",
|
|
|
|
"NDEBUG",
|
|
|
|
],
|
|
|
|
CCFLAGS=[
|
|
|
|
"-Og",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-10-28 18:32:06 +03:00
|
|
|
ENV.AppendUnique(
|
2022-06-26 15:00:03 +03:00
|
|
|
LINKFLAGS=[
|
2022-10-28 18:32:06 +03:00
|
|
|
"-specs=nano.specs",
|
|
|
|
"-Wl,--gc-sections",
|
|
|
|
"-Wl,--undefined=uxTopUsedPriority",
|
|
|
|
"-Wl,--wrap,_malloc_r",
|
|
|
|
"-Wl,--wrap,_free_r",
|
|
|
|
"-Wl,--wrap,_calloc_r",
|
|
|
|
"-Wl,--wrap,_realloc_r",
|
|
|
|
"-n",
|
|
|
|
"-Xlinker",
|
|
|
|
"-Map=${TARGET}.map",
|
|
|
|
"-T${LINKER_SCRIPT_PATH}",
|
2022-06-26 15:00:03 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-10-28 18:32:06 +03:00
|
|
|
|
2022-06-26 15:00:03 +03:00
|
|
|
if ENV["FIRMWARE_BUILD_CFG"] == "updater":
|
|
|
|
ENV.Append(
|
|
|
|
IMAGE_BASE_ADDRESS="0x20000000",
|
2023-02-07 19:33:05 +03:00
|
|
|
LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_ram,
|
2022-06-26 15:00:03 +03:00
|
|
|
)
|
|
|
|
else:
|
|
|
|
ENV.Append(
|
|
|
|
IMAGE_BASE_ADDRESS="0x8000000",
|
2023-02-07 19:33:05 +03:00
|
|
|
LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_flash,
|
|
|
|
APP_LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_app,
|
2022-06-26 15:00:03 +03:00
|
|
|
)
|