Skip to content

Commit

Permalink
Updated SConstruct/SConscript files to handle 5d-shield add-ons better.
Browse files Browse the repository at this point in the history
Also, changed the build_all.sh script.
  • Loading branch information
giseburt committed Nov 9, 2011
1 parent de93df7 commit 59ef0f1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
4 changes: 4 additions & 0 deletions firmware/SConstruct
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,10 @@
platform = ARGUMENTS.get('platform','mb24') platform = ARGUMENTS.get('platform','mb24')
fived = ARGUMENTS.get('fived','false')


if (platform == 'rrmbv12' or platform == 'mb24' or platform == 'mb24-2560'): if (platform == 'rrmbv12' or platform == 'mb24' or platform == 'mb24-2560'):
if (fived == 'true'):
platform = platform+'-5d'

SConscript(['src/SConscript.motherboard'], variant_dir='build/'+platform) SConscript(['src/SConscript.motherboard'], variant_dir='build/'+platform)


elif (platform == 'ecv22' or platform == 'ecv34'): elif (platform == 'ecv22' or platform == 'ecv34'):
Expand Down
34 changes: 13 additions & 21 deletions firmware/build_all.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,33 +2,27 @@


SCONS=SConstruct SCONS=SConstruct


PLATFORMS=( rrmbv12 mb24 mb24-2560 ecv22 ecv34 ) PLATFORMS=( rrmbv12 'rrmbv12 fived=true' mb24 mb24-2560 ecv22 ecv34 )


LOG_FILE=build_all_output LOG_FILE=build_all_output




function build_firmware { function build_firmware {
platform_list_name="$1[*]" for platform in "${PLATFORMS[@]}"
platform_list=(${!platform_list_name})
scons_file=$2

for platform in ${platform_list[@]}
do do
echo -n "Building firmware for ${platform}... " echo -n "Building firmware for ${platform}... "

echo -e "\n\n\n\n" >> ${LOG_FILE}
echo Building firmware for ${platform} >> ${LOG_FILE}

scons -f ${scons_file} platform=${platform} >> ${LOG_FILE} 2>&1


if [ "$?" -ne "0" ]; then echo -e "\n\n\n\n" >> ${LOG_FILE}
echo Failure echo Building firmware for ${platform} >> ${LOG_FILE}
else
echo Success
fi
done


scons -f "${SCONS}" platform=${platform} >> ${LOG_FILE} 2>&1


if [ "$?" -ne "0" ]; then
echo Failure
else
echo Success
fi
done
} }




Expand All @@ -51,8 +45,6 @@ function build_documentation {
echo Building all firmware echo Building all firmware
echo "Building all firmware" > ${LOG_FILE} echo "Building all firmware" > ${LOG_FILE}


build_firmware PLATFORMS ${SCONS} build_firmware




build_documentation build_documentation
5 changes: 4 additions & 1 deletion firmware/src/SConscript.motherboard
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ vstr = File('#/current_version.txt').get_contents().strip()
vstr = ARGUMENTS.get('version',vstr) vstr = ARGUMENTS.get('version',vstr)


version = parse_version(vstr) version = parse_version(vstr)
subplatform = ""
if (fived == 'true'):
subplatform = "-5d"


target_name = "MB-"+platform+"-v"+str(version//100)+"."+str(version%100) target_name = "MB-"+platform+subplatform+"-v"+str(version//100)+"."+str(version%100)


if (platform == 'rrmbv12'): if (platform == 'rrmbv12'):
default_baud = '38400' default_baud = '38400'
Expand Down

0 comments on commit 59ef0f1

Please sign in to comment.