flipperzero-firmware/site_scons/firmwareopts.scons

64 lines
1.3 KiB
Plaintext
Raw Normal View History

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",
],
)
ENV.AppendUnique(
LINKFLAGS=[
"-specs=nano.specs",
"-specs=nosys.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}",
],
)
if ENV["FIRMWARE_BUILD_CFG"] == "updater":
ENV.Append(
IMAGE_BASE_ADDRESS="0x20000000",
LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_ram,
)
else:
ENV.Append(
IMAGE_BASE_ADDRESS="0x8000000",
LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_flash,
APP_LINKER_SCRIPT_PATH=ENV["TARGET_CFG"].linker_script_app,
)