Question

I'm trying to use the Keil C51 compiler with scons as a build system.

The final problem I have is how to get $SOURCES to be output comma-separated to the linker. The default uses space as separator.

The relevant parts of the SConstruct is

path = ['C:\Keil\C51\BIN']
env = Environment(ENV = {'PATH' : path})

#Compiler settings
env['CC']        = 'c51.exe' 
env['CCCOM']     = '$CC $SOURCES $_CPPINCFLAGS $CFLAGS  $_CCCOMCOM ' #-o $TARGET 
env['INCPREFIX']  = 'INCDIR('
env['INCSUFFIX']  = ')'

# Linker settings
env.Replace(LINK='BL51.exe')
env['LINKCOM']     = '$LINK $SOURCES TO $TARGET $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'

With this I get:

BL51.exe driver.obj flash.obj initialization.obj power.obj TO Outfile.omf

What I want is:

BL51.exe driver.obj,flash.obj,initialization.obj,power.obj TO Outfile.omf

$SOURCES is a construction variable and I cant find how to change how it is printed to the command-line.

Anyone?

Was it helpful?

Solution

I solved this by using:

    env['LINKCOM']     = '$LINK ",".join( $SOURCES ) TO $TARGET $LINKFLAGS $__RPATH $_LIBDIRFLAGS $_LIBFLAGS'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top