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

@@ -20,7 +20,12 @@
import os.path
import subprocess
Import('environment', 'images', 'posixServicesDirectory')
Import('environment', 'images', 'libsInOrder')
e = environment.Clone()
e.Append(LINKFLAGS = ['-T' + e['buildDirectory'] + '/loader/linker.lds'])
e.Append(LIBS = libsInOrder)
e.Append(CPPPATH = ['#libs/elf/include', '#' + e['buildDirectory'] + '/loader'])
def convertAddress(address):
'''Convert the string representation of the address given as parameter to a string representation of the
@@ -129,10 +134,10 @@ linkerScript = Command('linker.lds', ['linker.lds.in'] + images, createLinkerScr
## TODO: deal with the situation where there are other .c and .S files in the directory.
objects = environment.Object(['arch.c' , kernelS, startAxfS, mainC])
Depends(objects, environment['configFiles'])
objects = e.Object(['arch.c' , kernelS, startAxfS, mainC])
Depends(objects, e['configFiles'])
Depends(objects, images)
program = environment.Program('final', objects + [environment['baremetal_crt0']])
program = e.Program('final', objects + [e['baremetal_crt0']])
Depends(program, linkerScript)
Return('program')