示例#1
0
cppflags += includeDirs
asflags  += includeDirs

ldflags += "-DF_CPU=16000000 -mmcu=atmega328p".split()
ldflags += "-Wl,--gc-sections".split()
preldflags += "-lm".split()
asflags += "-DF_CPU=16000000 -mmcu=atmega328p".split()
preasflags += "-x assembler-with-cpp".split()

#----------------------------------------------------------------------
#--- Try to detect automatically the location of libc and libgcc
#--- This supposes the compiler has a (something)-gcc name
#--- for non posix target
#----------------------------------------------------------------------
if "gcc" in compiler:
  compilerFullPath = makefile.find_executable(compiler)
  if compilerFullPath != None:
    #--- Extract the (something) from the compiler executable name
    compilerParts = compiler.split('-')
    compilerParts.pop()
    compilerPrefix = "-".join(compilerParts)
    #--- Get the full path of the compiler
    compilerToolChainPath = os.path.dirname(os.path.dirname(compilerFullPath))
    #--- Get the version of the compiler, [:-1] removes the carriage return
    compilerVersion = subprocess.check_output([compiler, '-dumpversion'])[:-1]
    #--- Build the libc and libgcc paths
    procLibc  =subprocess.Popen([compilerFullPath,"-print-file-name=libc.a"]+cflags,stdout=subprocess.PIPE)
    procLibgcc=subprocess.Popen([compilerFullPath,"-print-libgcc-file-name"]+cflags,stdout=subprocess.PIPE)
    procLibc.wait()
    procLibgcc.wait()
    libcPath = os.path.dirname(procLibc.stdout.readline().strip())
示例#2
0
ldflags += "--gc-sections".split()
ldflags += ["-T", "lab1/script.ld"]
asflags += "-g".split()
asflags += "-Wall".split()
asflags += "-mcpu=cortex-m4".split()
asflags += "-mthumb".split()
asflags += "--fatal-warnings".split()
asflags += "-mfloat-abi=soft".split()
asflags += "-mfpu=fpv4-sp-d16".split()

#----------------------------------------------------------------------
#--- Try to detect automatically the location of libc and libgcc
#--- This supposes the compiler has a (something)-gcc name
#----------------------------------------------------------------------
if "gcc" in compiler:
    compilerFullPath = makefile.find_executable(compiler)
    if compilerFullPath != None:
        #--- Extract the (something) from the compiler executable name
        compilerParts = compiler.split('-')
        compilerParts.pop()
        compilerPrefix = "-".join(compilerParts)
        #--- Get the full path of the compiler
        compilerToolChainPath = os.path.dirname(
            os.path.dirname(compilerFullPath))
        #--- Get the version of the compiler, [:-1] removes the carriage return
        compilerVersion = subprocess.check_output([compiler,
                                                   '-dumpversion'])[:-1]
        #--- Build the libc path
        libcPath = compilerToolChainPath + '/' + compilerPrefix + '/lib/armv7e-m'
        #--- Build the libgcc path
        libgccPath = compilerToolChainPath + '/lib/gcc/' + compilerPrefix + '/' + compilerVersion + '/armv7e-m'
示例#3
0
文件: build.py 项目: LMG/enforcer
ldflags += ["-T", "autosar_tp_s1/script.ld"]
asflags += "-g".split()
asflags += "-Wall".split()
asflags += "-mcpu=cortex-m4".split()
asflags += "-mthumb".split()
asflags += "--fatal-warnings".split()
asflags += "-mfloat-abi=soft".split()
asflags += "-mfpu=fpv4-sp-d16".split()


#----------------------------------------------------------------------
#--- Try to detect automatically the location of libc and libgcc
#--- This supposes the compiler has a (something)-gcc name
#----------------------------------------------------------------------
if "gcc" in compiler:
  compilerFullPath = makefile.find_executable(compiler)
  if compilerFullPath != None:
    #--- Extract the (something) from the compiler executable name
    compilerParts = compiler.split('-')
    compilerParts.pop()
    compilerPrefix = "-".join(compilerParts)
    #--- Get the full path of the compiler
    compilerToolChainPath = os.path.dirname(os.path.dirname(compilerFullPath))
    #--- Get the version of the compiler, [:-1] removes the carriage return
    compilerVersion = subprocess.check_output([compiler, '-dumpversion'])[:-1]
    #--- Build the libc path
    libcPath = compilerToolChainPath + '/' + compilerPrefix + '/lib/armv7e-m'
    #--- Build the libgcc path
    libgccPath = compilerToolChainPath + '/lib/gcc/' + compilerPrefix + '/' + compilerVersion + '/armv7e-m'
    #--- Add both to linker flags
    ldflags += ['-L' + libcPath, '-lc']
示例#4
0
文件: build.py 项目: 1984c/trampoline
ldflags += "--no-undefined".split()
ldflags += "-L/Users/DavidGarriou/Tools/gcc/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3 -lgcc".split()
ldflags += "-L/Users/DavidGarriou/Tools/gcc/gcc-arm-none-eabi/arm-none-eabi/lib -lc".split()
ldflags += ["-T", "lonely/script.ld"]
asflags += "-g".split()
asflags += "-mcpu=arm7tdmi-s".split()
asflags += "--fatal-warnings".split()
asflags += "-mfloat-abi=soft".split()


#----------------------------------------------------------------------
#--- Try to detect automatically the location of libc and libgcc
#--- This supposes the compiler has a (something)-gcc name
#----------------------------------------------------------------------
if "gcc" in compiler:
  compilerFullPath = makefile.find_executable(compiler)
  if compilerFullPath != None:
    #--- Extract the (something) from the compiler executable name
    compilerParts = compiler.split('-')
    compilerParts.pop()
    compilerPrefix = "-".join(compilerParts)
    #--- Get the full path of the compiler
    compilerToolChainPath = os.path.dirname(os.path.dirname(compilerFullPath))
    #--- Get the version of the compiler, [:-1] removes the carriage return
    compilerVersion = subprocess.check_output([compiler, '-dumpversion'])[:-1]
    #--- Build the libc path
    libcPath = compilerToolChainPath + '/' + compilerPrefix + '/lib'
    #--- Build the libgcc path
    libgccPath = compilerToolChainPath + '/lib/gcc/' + compilerPrefix + '/' + compilerVersion
    #--- Add both to linker flags
    ldflags += ['-L' + libcPath, '-lc']
示例#5
0
ldflags += "-L/Users/DavidGarriou/Tools/gcc/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/4.9.3 -lgcc".split(
)
ldflags += "-L/Users/DavidGarriou/Tools/gcc/gcc-arm-none-eabi/arm-none-eabi/lib -lc".split(
)
ldflags += ["-T", "lonely/script.ld"]
asflags += "-g".split()
asflags += "-mcpu=arm7tdmi-s".split()
asflags += "--fatal-warnings".split()
asflags += "-mfloat-abi=soft".split()

#----------------------------------------------------------------------
#--- Try to detect automatically the location of libc and libgcc
#--- This supposes the compiler has a (something)-gcc name
#----------------------------------------------------------------------
if "gcc" in compiler:
    compilerFullPath = makefile.find_executable(compiler)
    if compilerFullPath != None:
        #--- Extract the (something) from the compiler executable name
        compilerParts = compiler.split('-')
        compilerParts.pop()
        compilerPrefix = "-".join(compilerParts)
        #--- Get the full path of the compiler
        compilerToolChainPath = os.path.dirname(
            os.path.dirname(compilerFullPath))
        #--- Get the version of the compiler, [:-1] removes the carriage return
        compilerVersion = subprocess.check_output([compiler,
                                                   '-dumpversion'])[:-1]
        #--- Build the libc path
        libcPath = compilerToolChainPath + '/' + compilerPrefix + '/lib'
        #--- Build the libgcc path
        libgccPath = compilerToolChainPath + '/lib/gcc/' + compilerPrefix + '/' + compilerVersion