forked from platformio/platformio-core
Improve building of ASM files
This commit is contained in:
@ -11,18 +11,17 @@ env = DefaultEnvironment()
|
|||||||
|
|
||||||
env.Replace(
|
env.Replace(
|
||||||
AR="arm-none-eabi-ar",
|
AR="arm-none-eabi-ar",
|
||||||
AS="arm-none-eabi-gcc",
|
AS="arm-none-eabi-as",
|
||||||
CC="arm-none-eabi-gcc",
|
CC="arm-none-eabi-gcc",
|
||||||
CXX="arm-none-eabi-g++",
|
CXX="arm-none-eabi-g++",
|
||||||
OBJCOPY="arm-none-eabi-objcopy",
|
OBJCOPY="arm-none-eabi-objcopy",
|
||||||
RANLIB="arm-none-eabi-ranlib",
|
RANLIB="arm-none-eabi-ranlib",
|
||||||
SIZETOOL="arm-none-eabi-size",
|
SIZETOOL="arm-none-eabi-size",
|
||||||
|
|
||||||
ASCOM=("$AS -o $TARGET -c -x assembler-with-cpp "
|
|
||||||
"$CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"),
|
|
||||||
|
|
||||||
ARFLAGS=["rcs"],
|
ARFLAGS=["rcs"],
|
||||||
|
|
||||||
|
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||||
|
|
||||||
CPPFLAGS=[
|
CPPFLAGS=[
|
||||||
"-g", # include debugging info (so errors include line numbers)
|
"-g", # include debugging info (so errors include line numbers)
|
||||||
"-Os", # optimize for size
|
"-Os", # optimize for size
|
||||||
@ -58,8 +57,7 @@ if env.get("BOARD_OPTIONS", {}).get("build", {}).get("cpu", "")[-2:] == "m4":
|
|||||||
env.Append(
|
env.Append(
|
||||||
ASFLAGS=[
|
ASFLAGS=[
|
||||||
"-mfloat-abi=hard",
|
"-mfloat-abi=hard",
|
||||||
"-mfpu=fpv4-sp-d16",
|
"-mfpu=fpv4-sp-d16"
|
||||||
"-fsingle-precision-constant"
|
|
||||||
],
|
],
|
||||||
CCFLAGS=[
|
CCFLAGS=[
|
||||||
"-mfloat-abi=hard",
|
"-mfloat-abi=hard",
|
||||||
|
@ -11,19 +11,18 @@ env = DefaultEnvironment()
|
|||||||
|
|
||||||
env.Replace(
|
env.Replace(
|
||||||
AR="avr-ar",
|
AR="avr-ar",
|
||||||
AS="avr-gcc",
|
AS="avr-as",
|
||||||
CC="avr-gcc",
|
CC="avr-gcc",
|
||||||
CXX="avr-g++",
|
CXX="avr-g++",
|
||||||
OBJCOPY="avr-objcopy",
|
OBJCOPY="avr-objcopy",
|
||||||
RANLIB="avr-ranlib",
|
RANLIB="avr-ranlib",
|
||||||
SIZETOOL="avr-size",
|
SIZETOOL="avr-size",
|
||||||
|
|
||||||
ASCOM=("$AS -o $TARGET -c -x assembler-with-cpp "
|
|
||||||
"$CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"),
|
|
||||||
|
|
||||||
ARFLAGS=["rcs"],
|
ARFLAGS=["rcs"],
|
||||||
|
|
||||||
CCFLAGS=[
|
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||||
|
|
||||||
|
CPPFLAGS=[
|
||||||
"-g", # include debugging info (so errors include line numbers)
|
"-g", # include debugging info (so errors include line numbers)
|
||||||
"-Os", # optimize for size
|
"-Os", # optimize for size
|
||||||
"-Wall", # show warnings
|
"-Wall", # show warnings
|
||||||
@ -33,15 +32,15 @@ env.Replace(
|
|||||||
"-mmcu=$BOARD_MCU"
|
"-mmcu=$BOARD_MCU"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
CPPDEFINES=[
|
||||||
|
"F_CPU=$BOARD_F_CPU"
|
||||||
|
],
|
||||||
|
|
||||||
CXXFLAGS=[
|
CXXFLAGS=[
|
||||||
"-fno-exceptions",
|
"-fno-exceptions",
|
||||||
"-fno-threadsafe-statics"
|
"-fno-threadsafe-statics"
|
||||||
],
|
],
|
||||||
|
|
||||||
CPPDEFINES=[
|
|
||||||
"F_CPU=$BOARD_F_CPU"
|
|
||||||
],
|
|
||||||
|
|
||||||
LINKFLAGS=[
|
LINKFLAGS=[
|
||||||
"-Os",
|
"-Os",
|
||||||
"-mmcu=$BOARD_MCU",
|
"-mmcu=$BOARD_MCU",
|
||||||
|
@ -16,18 +16,17 @@ env = DefaultEnvironment()
|
|||||||
|
|
||||||
env.Replace(
|
env.Replace(
|
||||||
AR="msp430-ar",
|
AR="msp430-ar",
|
||||||
AS="msp430-gcc",
|
AS="msp430-as",
|
||||||
CC="msp430-gcc",
|
CC="msp430-gcc",
|
||||||
CXX="msp430-g++",
|
CXX="msp430-g++",
|
||||||
OBJCOPY="msp430-objcopy",
|
OBJCOPY="msp430-objcopy",
|
||||||
RANLIB="msp430-ranlib",
|
RANLIB="msp430-ranlib",
|
||||||
SIZETOOL="msp430-size",
|
SIZETOOL="msp430-size",
|
||||||
|
|
||||||
ASCOM=("$AS -o $TARGET -c -x assembler-with-cpp "
|
|
||||||
"$CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"),
|
|
||||||
|
|
||||||
ARFLAGS=["rcs"],
|
ARFLAGS=["rcs"],
|
||||||
|
|
||||||
|
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||||
|
|
||||||
CCFLAGS=[
|
CCFLAGS=[
|
||||||
"-g", # include debugging info (so errors include line numbers)
|
"-g", # include debugging info (so errors include line numbers)
|
||||||
"-Os", # optimize for size
|
"-Os", # optimize for size
|
||||||
|
@ -9,12 +9,20 @@ from os.path import basename, dirname, isdir, isfile, join, normpath
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from SCons.Script import Exit, SConscript, SConscriptChdir
|
from SCons.Script import Exit, SConscript, SConscriptChdir
|
||||||
|
from SCons.Util import case_sensitive_suffixes
|
||||||
from serial import Serial
|
from serial import Serial
|
||||||
|
|
||||||
from platformio.util import get_serialports
|
from platformio.util import get_serialports
|
||||||
|
|
||||||
|
|
||||||
def ProcessGeneral(env):
|
def ProcessGeneral(env):
|
||||||
|
# fix ASM handling under non-casitive OS
|
||||||
|
if not case_sensitive_suffixes('.s', '.S'):
|
||||||
|
env.Replace(
|
||||||
|
AS="$CC",
|
||||||
|
ASCOM="$ASPPCOM"
|
||||||
|
)
|
||||||
|
|
||||||
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
|
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
|
||||||
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
|
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user