Refactor the build to try and get as much material as possible out of SConstruct.

This commit is contained in:
Russel Winder
2009-08-28 14:10:24 +01:00
parent c311cf72e6
commit 9e894274a3
10 changed files with 85 additions and 79 deletions

View File

@@ -23,6 +23,10 @@ import shutil
Import('environment', 'images')
e = environment.Clone()
e.Append(LINKFLAGS = ['-T' + e['posixServicesDirectory'] + '/bootdesc/linker.lds'])
e.Append(CPPPATH = ['#' + e['includeDirectory']])
bootdescTemplate = \
'''
/* This file is autogenerated, do not edit by hand. */
@@ -85,10 +89,9 @@ def relocateBootdesc(target, source, env):
os.system("arm-none-linux-gnueabi-objcopy --adjust-section-vma .data=" + end + " " + source[0].path)
shutil.copyfile(source[0].path, target[0].path)
bootdescSource = environment.Command('bootdesc.c', images, generateBootdesc)
objects = environment.Object(bootdescSource)
Depends(objects, environment['configFiles'])
bootdesc = environment.Command('bootdesc.axf', environment.Program('bootdesc_intermediate', objects) + [images[1]] , relocateBootdesc)
Depends(bootdesc, environment['configFiles'])
objects = e.Object(e.Command('bootdesc.c', images, generateBootdesc))
Depends(objects, e['configFiles'])
bootdesc = e.Command('bootdesc.axf', e.Program('bootdesc_intermediate', objects) + [images[1]] , relocateBootdesc)
Depends(bootdesc, e['configFiles'])
Return('bootdesc')