Improve building of ASM files

This commit is contained in:
Valeriy Koval
2015-02-24 18:15:17 +02:00
parent d142b6e6d1
commit fedb7527f4
4 changed files with 23 additions and 19 deletions

View File

@ -11,18 +11,17 @@ env = DefaultEnvironment()
env.Replace(
AR="arm-none-eabi-ar",
AS="arm-none-eabi-gcc",
AS="arm-none-eabi-as",
CC="arm-none-eabi-gcc",
CXX="arm-none-eabi-g++",
OBJCOPY="arm-none-eabi-objcopy",
RANLIB="arm-none-eabi-ranlib",
SIZETOOL="arm-none-eabi-size",
ASCOM=("$AS -o $TARGET -c -x assembler-with-cpp "
"$CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"),
ARFLAGS=["rcs"],
ASPPFLAGS=["-x", "assembler-with-cpp"],
CPPFLAGS=[
"-g", # include debugging info (so errors include line numbers)
"-Os", # optimize for size
@ -58,8 +57,7 @@ if env.get("BOARD_OPTIONS", {}).get("build", {}).get("cpu", "")[-2:] == "m4":
env.Append(
ASFLAGS=[
"-mfloat-abi=hard",
"-mfpu=fpv4-sp-d16",
"-fsingle-precision-constant"
"-mfpu=fpv4-sp-d16"
],
CCFLAGS=[
"-mfloat-abi=hard",

View File

@ -11,19 +11,18 @@ env = DefaultEnvironment()
env.Replace(
AR="avr-ar",
AS="avr-gcc",
AS="avr-as",
CC="avr-gcc",
CXX="avr-g++",
OBJCOPY="avr-objcopy",
RANLIB="avr-ranlib",
SIZETOOL="avr-size",
ASCOM=("$AS -o $TARGET -c -x assembler-with-cpp "
"$CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"),
ARFLAGS=["rcs"],
CCFLAGS=[
ASPPFLAGS=["-x", "assembler-with-cpp"],
CPPFLAGS=[
"-g", # include debugging info (so errors include line numbers)
"-Os", # optimize for size
"-Wall", # show warnings
@ -33,15 +32,15 @@ env.Replace(
"-mmcu=$BOARD_MCU"
],
CPPDEFINES=[
"F_CPU=$BOARD_F_CPU"
],
CXXFLAGS=[
"-fno-exceptions",
"-fno-threadsafe-statics"
],
CPPDEFINES=[
"F_CPU=$BOARD_F_CPU"
],
LINKFLAGS=[
"-Os",
"-mmcu=$BOARD_MCU",

View File

@ -16,18 +16,17 @@ env = DefaultEnvironment()
env.Replace(
AR="msp430-ar",
AS="msp430-gcc",
AS="msp430-as",
CC="msp430-gcc",
CXX="msp430-g++",
OBJCOPY="msp430-objcopy",
RANLIB="msp430-ranlib",
SIZETOOL="msp430-size",
ASCOM=("$AS -o $TARGET -c -x assembler-with-cpp "
"$CFLAGS $CCFLAGS $_CCCOMCOM $SOURCES"),
ARFLAGS=["rcs"],
ASPPFLAGS=["-x", "assembler-with-cpp"],
CCFLAGS=[
"-g", # include debugging info (so errors include line numbers)
"-Os", # optimize for size

View File

@ -9,12 +9,20 @@ from os.path import basename, dirname, isdir, isfile, join, normpath
from time import sleep
from SCons.Script import Exit, SConscript, SConscriptChdir
from SCons.Util import case_sensitive_suffixes
from serial import Serial
from platformio.util import get_serialports
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", {}):
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))